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

Analysis should not run in referencing projects. #37107

Open
ItsSmiffy opened this issue Jul 10, 2019 · 3 comments
Open

Analysis should not run in referencing projects. #37107

ItsSmiffy opened this issue Jul 10, 2019 · 3 comments

Comments

@ItsSmiffy
Copy link

ItsSmiffy commented Jul 10, 2019

I have two projects, A and A.Tests.
A.Tests references A.
I have added fxcopanalyzers (v2.9.3) via NuGet into project A.
The analyzers are being pulled in and ran on the A.Tests project.

I have added <PrivateAssets>all</PrivateAssets> in the PackageReference for FxCopAnalyzers in project A (as mentioned in #24732) but hasn't resolved the issue; The analysis results are still appearing the the Error List for the A.Tests project.

n.b. Project A is a .NET Standard 2.0 project, Project A.Tests is a .NET Core 2.0.

@vatsalyaagrawal
Copy link
Contributor

@mavasani for initial invesitgation.

@mavasani
Copy link
Contributor

This indeed looks like a duplicate of #24732 which has been duped to NuGet/Home#4125. @ItsSmiffy did you try to close/re-open solution? Can you provide a repro project?

@ItsSmiffy
Copy link
Author

@mavasani yes, I closed/re-opened the solution which didn't seem to resolve the issue.
When creating a sample repo I could not reproduce the issue.
So going back to my original solution/projects I found that removing the project reference (which consumes the analyzers) from the Test project then re-adding the project to the Test project seems to ensure the Analyzers do not flow down to the Test project.

@jinujoseph jinujoseph modified the milestones: 16.3, Backlog Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants