2
votes

When using Visual Studio 2015, Roslyn Compiler platform is used for Code Analysis.

How do I check which version of Roslyn is being used there?

2

2 Answers

4
votes

You can always just do csc /?, and we'll print the version header.

>csc /?
Microsoft (R) Visual C# Compiler version 1.0.0.50618
Copyright (C) Microsoft Corporation. All rights reserved.
3
votes

When you run code analysis on your project, a build is executed first. You can set the output verbosity in Visual Studio to "Detailed" in VS/Tools/Options/Projects and Solutions/Build and Run/MSBuild project build output verbosity.

In the output log, you'll find the following:

1>Using "Csc" task from assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.CodeAnalysis.dll".
1>Task "Csc"
1>  C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig ...
1>  Microsoft (R) Visual C# Compiler version 1.0.0.50618
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>Done executing task "Csc".

And then there is the "CodeAnalysis" task which is running FxCop. FxCop analyze the output assembly, so there's no compilation involved there.

1>Task "CodeAnalysis"
1>  Running Code Analysis...
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe  ...

So, the same csc.exe is used for the code analysis as for a normal build.