The Run Code Analysis function is missing in Visual Studio 2017 when using new csproj format.
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
@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.
I believe Code Metrics has the same issue.