question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Run Code Analysis function is missing in Visual Studio 2017 when using new csproj format.

See original GitHub 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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
srivatsncommented, Apr 21, 2017

So is it possible to run the same analyser rules with Roslyn now? I cannot find any help for doing such thing.

@jinujoseph was talking about writing a doc about that.

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.

Ah yes for netstandard it might work but I believe it is broken for netcore. Either way it’s not tested and

But what about Visual Studio code analyser, does it get updates/fixes or is the focus only by roslyn analyser?

The plan is to update the VS code analysis experience to be powered by Roslyn.

1reaction
jnm2commented, Oct 5, 2017

I believe Code Metrics has the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Run Code Analysis function is missing in Visual Studio ...
I want to use the Visual Studio Code analyser for my new .netstandard libray project. But when I right click on the project...
Read more >
Upgrading an existing .NET project files to the lean new ...
First, and above all, run the .NET Portability Analyzer and find out how much of your code is portable. Then you have two...
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
Quick solution for Visual Studio users; This project references NuGet package(s) that are missing on this computer ...
Read more >
Fixing missing project.json error in old csproj format
The file in question seems to named project.assets.json. Deleting these in all subfolders seems to do the trick. Run, from the root of...
Read more >
Managing Dependencies in .NET: .csproj, .packages.config ...
Since Visual Studio 2017, a project has been represented by a .csproj file with dependencies (NuGet package references) listed in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found