Skip to content
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

Enable code analysis #988

Closed
jnm2 opened this issue Dec 17, 2016 · 8 comments
Closed

Enable code analysis #988

jnm2 opened this issue Dec 17, 2016 · 8 comments
Assignees
Labels
Triage-No-Action Not a bug, by design or an answered question.
Milestone

Comments

@jnm2
Copy link

jnm2 commented Dec 17, 2016

In build 15.0.26014.0:

  • Analyze > Run Code Analysis > On Solution
    • does nothing
  • Analyze > Configure Code Analysis > For Solution
    • shows "There are currently no analyzable projects loaded."
@davkean
Copy link
Member

davkean commented Dec 18, 2016

Thanks - by Code Analysis here, you're looking to use FxCop and not C#/VB's automatic analysis?

@jnm2
Copy link
Author

jnm2 commented Dec 19, 2016

Yes, FxCop on a library targeting net20 and netstandard1.3.

@srivatsn srivatsn added this to the 1.0 RTM milestone Dec 21, 2016
@srivatsn srivatsn added the Bug label Dec 21, 2016
mavasani added a commit to mavasani/project-system that referenced this issue Jan 18, 2017
1. Mimic the behavior of native project system to load stancore package for code analysis, if installed.
2. Turn on the CodeAnalysis specific global build properties for enabling FxCop when build is invoked from Run Code Analysis.

Fixes dotnet#988
@srivatsn srivatsn modified the milestones: 1.0 RTM, 1.1 Jan 19, 2017
@srivatsn srivatsn modified the milestones: 2.0, 1.1 Feb 21, 2017
@ulrichb
Copy link
Contributor

ulrichb commented Mar 25, 2017

Really milestone 16.0? We need FxCop mainly for CA2000 which still has no replacement (I'm aware of). See dotnet/roslyn-analyzers#476.

@Thieum
Copy link

Thieum commented Aug 10, 2018

If you are using custom rules, and custom analyzers as Visual Studio extensions, you need to edit the csproj file and add

<CodeAnalysisRuleSet>..\MyCompanyCodeAnalysisRules.ruleset</CodeAnalysisRuleSet>

in the PropertyGroup

to match the behavior of the .net Framework projects. (from https://stackoverflow.com/a/44726528/444469)

Would be nice to be able to edit this property in the project properties, as the analyzers will default to their own configuration without the correct value.

@mavasani mavasani removed their assignment Feb 7, 2019
@jjmew jjmew modified the milestones: 16.0, 16.X Feb 13, 2019
@dmonroym dmonroym added the Triage-Investigate Reviewed and investigation needed by dev team label Aug 31, 2020
@dmonroym dmonroym added this to the Backlog milestone Aug 31, 2020
@dmonroym dmonroym removed the Triage-Investigate Reviewed and investigation needed by dev team label Aug 31, 2020
@drewnoakes
Copy link
Member

Let's review this together in the next triage session.

Running Analyze > Run Code Analysis > On Solution shows that analysis is running in the status bar, but no results are produced. This occurs in both project systems, so I cannot see what action is needed here. I may misunderstand the feature though.

Running Analyze > Configure Code Analysis > For Solution shows:

image

NOTE: This property page has been deprecated and will be removed in a future product release. Learn more at https://docs.microsoft.com/visualstudio/code-quality/analyzers-faq#code-analysis-solution-property-page

@mavasani
Copy link
Contributor

mavasani commented Sep 1, 2020

@drewnoakes That command now runs installed analyzers. Can you try to install an analyzer package to the project and retry?

@davkean
Copy link
Member

davkean commented Sep 1, 2020

I think we can close this; the FxCop and other source-based analyzers have replaced binary analysis that this used to perform, see: https://docs.microsoft.com/en-us/visualstudio/code-quality/migrate-from-legacy-analysis-to-fxcop-analyzers?view=vs-2019.

@davkean davkean added the Triage-No-Action Not a bug, by design or an answered question. label Sep 1, 2020
@jnm2
Copy link
Author

jnm2 commented Sep 2, 2020

Yes, the FxCopAnalyzers package has totally replaced my need for this.

@jnm2 jnm2 closed this as completed Sep 2, 2020
@drewnoakes drewnoakes removed the Bug label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage-No-Action Not a bug, by design or an answered question.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants