Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install the VS2019 CodeAnalyis tools using vs_BuildTools.exe

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?

like image 358
Mike Christensen Avatar asked Sep 17 '25 16:09

Mike Christensen


1 Answers

This worked for me

--add Microsoft.VisualStudio.Component.Roslyn.LanguageServices
like image 99
Christian Bumann Avatar answered Sep 19 '25 06:09

Christian Bumann