New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Run Code Analysis function is missing in Visual Studio 2017 when using new csproj format. #1086
Comments
@srivatsn @davkean @AnthonyDGreen Do we have guidance on how to set up Roslyn Analyzers to replace code analysis? |
This would be nice. So is the Visual Studio Code Analysis dead? And we should take Roslyn Analyser instead? |
The implementation behind VS's CodeAnalysis feature is being replaced. It used to work by doing binary analysis (FxCop) and it is going to be switched to doing source analysis using Roslyn analyzers. So the scenario\experience is not dead - just the old analysis engine which doesn't support netstandard. |
So is it possible to run the same analyser rules with Roslyn now? I cannot find any help for doing such thing.
it is possible to run the analyser for netstandard libraries as you can see in my first post. It is only the visual studio integration which is missing. But what about Visual Studio code analyser, does it get updates/fixes or is the focus only by roslyn analyser? Thank you for your help. |
@jinujoseph was talking about writing a doc about that.
Ah yes for netstandard it might work but I believe it is broken for netcore. Either way it's not tested and
The plan is to update the VS code analysis experience to be powered by Roslyn. |
@jinujoseph is this something that you can take over? Thanks! |
yes moved over to analyzer repo dotnet/roslyn-analyzers#1310 |
I believe Code Metrics has the same issue. |
I want to use the Visual Studio Code analyser for my new .netstandard libray project. But when I right click on the project there is no analyse menu item anymore. It seems that all projects which use the new csproj formats cannot be analysed with the analyser.
Is this known?
Update:
If I add the following to the csproj file:
<RunCodeAnalysis>true</RunCodeAnalysis> <CodeAnalysisRuleSet>...</CodeAnalysisRuleSet>
and when I then build the project with MSBuild 15 it will run the code anaysis and generates the following warning:
MSBUILD : warning : CA0068 : Debug information could not be found for target assembly 'CodeAnalyseTest.dll'. For b est analysis results, include the .pdb file with debug information for 'CodeAnalyseTest.dll' in the same directory a s the target assembly.
But the .pdb is there. When I add now a
<DebugType>Full</DebugType>
to the csproj and then rebuild it with msbuild the code analyse works well.
But why is it impossible to do this with Visual Studio?
Update2:
If I add the RunCodeAnalysis tag to the project file then it will run the analysis on each build even in Visual Studio. But this is not what I want. I want to choose when I the analyse has to run.
The text was updated successfully, but these errors were encountered: