In VS 2017, VS 2015 Static Analysis Tools Not Found

  • Thread starter Thread starter Jesdisciple
  • Start date Start date
J

Jesdisciple

Guest
Windows 10
Visual Studio 2017

Related: MSB4018 The NativeCodeAnalysis task failed unexpectedly. (#1481) · Issues · graphviz / graphviz · GitLab

I'm trying to build Graphviz in Windows. Whoever last worked on the Windows glue is unavailable/unknown, so hopefully this is a straightforward problem.

Adapting the instructions here, I cloned from Git and used this PowerShell script in the repo root:

git submodule update --init
$env:Path = "$pwd\windows\dependencies\graphviz-build-utilities;$env:Path"
& "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" ".\graphviz.sln"

Upon building, I get a variation of the following error for each project in the solution. Can I get a lead on this problem, please? (Per my system's directory structure, the missing folder is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools.)

Error MSB4018 The "NativeCodeAnalysis" task failed unexpectedly.
Microsoft.VisualStudio.CodeAnalysis.AnalysisResults.AnalysisResultException: CA0001 : An unknown error occurred while running Code Analysis. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at Microsoft.VisualStudio.CodeAnalysis.RuleSets.RuleSetXmlProcessor.ReadFromFile(String filePath)
at Microsoft.VisualStudio.CodeAnalysis.RuleSets.RuleSet.LoadFromFile(String filePath, IEnumerable`1 ruleProviders)
at Microsoft.Build.Tasks.NativeCodeAnalysis.LoadRuleSet(String ruleSetFile)
at Microsoft.Build.Tasks.NativeCodeAnalysis.Execute()
--- End of inner exception stack trace ---
at Microsoft.Build.Tasks.NativeCodeAnalysis.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() expr C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.CodeAnalysis.targets 407

Continue reading...
 
Back
Top