-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Running Code Metrics on CPS project targeting .NET Core/.NET Standard displays an error #27001
Comments
Make note, we recently changed Project.Kind to return the legacy project system which unblocked this path and Code Metrics now shows up. |
@mavasani I'm changing this to Area-External as I believe it's part of CodeAnalysisPackage (StanCore). If this is not correct please change it back. |
Area-External means "we don't own it". We own this. |
Tagging @jinujoseph The Code Metrics command handlers are currently statically hooked up with project type GUIDs, hence always show up for all C#, VB and C++ projects, until the Metrics Package gets loaded in VS (which happens when either user first attempts to calculate code metrics or opens the Code Metrics results window). Run Code Analysis command(s) on the other hand has duplicate handling in the shell and StanCore assemblies, but is dynamically setup only for legacy C# and VB project system. I talked with @jinujoseph and we are going for the following approach:
Note that after the first attempt, the menu will not show up for CPS projects.
|
|
@davkean There are couple of reasons not to do your suggested change now:
|
Help me understand the risk with using context based rules? Here's an example of a definition: https://github.com/dotnet/project-system/blob/master/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/Packaging/ManagedProjectSystemPackage.cs#L22. |
On second thought, I feel we should do nothing here in 15.8 and instead figure out the story for Code Metrics for 16.0: deprecate it or fully support it for all TFMs, especially as we are very sure that we want to deprecate binary FxCop and the FxCop analysis engine that current Code Metrics implementation is based upon in 16.0. |
I'd very much like to see Code Metrics support added for Core/Standard projects. Please consider it as a priority to include in an upcoming (soon) release, since currently behavior feels like VS is going backward, losing functionality it's had for many years/versions. Thanks! |
Fixed with internal VSO PR. The fix should be available in Dev16 P1. |
To clarify: With Dev16 P1, Code Metrics should work for all C# and VB projects. Given the number of customer requests, we have also ported Code metrics related FxCop rules to analyzers with dotnet/roslyn-analyzers#1740. We also plan to provide a command line executable, such as Metrics.exe in pre-Dev15 versions, dotnet/roslyn-analyzers#1741 tracks that work. |
This error is still present for .NET Core Projects. (.net core version 2.1) (VS Version 15.8.1)
|
This should work with Dev16 Preview1. Alternatively, you can build Metrics.csproj from Roslyn-analyzers repo and use the built exe to generate a code metrics report from command line. |
See dotnet/roslyn-analyzers#1754 for usage of Metrics.exe. |
What version of visual studio is Dev16 Preview 1? |
@bearslumber It is not part of VS2017 (i.e. version 15.x.x or Dev15), but should be part of VS2019 (i.e., version 16.x.x or Dev16). See https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-preview. |
Version Used:
15.8 Preview 3
Steps to Reproduce:
Expected Behavior:
Succeeded
Actual Behavior:
Note: If you target .NET Framework from the project than it succeeds.
The text was updated successfully, but these errors were encountered: