Open ItsSmiffy opened 5 years ago
@mavasani for initial invesitgation.
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?
@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.
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.