3

We're upgrading our build agents from VS2017 to VS2019. We use CodeAnalysis in our CI pipeline, so we install the CodeAnalysis workload using:

C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --add Microsoft.VisualStudio.Component.Static.Analysis.Tools

This creates a directory called C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\CodeAnalysis

When I try this with VS2019, I don't get such a directory. I've checked other possible locations by searching for Microsoft.CodeAnalysis.Targets as well.

The docs seem to say it's in Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools, but that doesn't work either. I've also tried Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Managed and Microsoft.Component.CodeAnalysis.SDK but no luck. Anyone know how to install this from the command line?

Mike Christensen
  • 88,082
  • 50
  • 208
  • 326
  • Are you looking for FxCop? Maybe the same as https://stackoverflow.com/questions/55598152/what-replaces-code-analysis-in-visual-studio-2019? – Jimmy May 25 '19 at 06:04
  • Yea, I think some stuff has moved around in this version. I'll have to figure out where the new stuff is and how to use it.. What's strange is when I install VS2019 Pro, I get that "CodeAnalysis" directory where I'd expect it, but it doesn't seem to get installed on our build machine using vs_buildtools.exe. – Mike Christensen May 25 '19 at 16:43

1 Answers1

5

This worked for me

--add Microsoft.VisualStudio.Component.Roslyn.LanguageServices
Jared Forth
  • 1,577
  • 6
  • 17
  • 32