Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Code Analysis Errors from NCrunch tests
swd120
#1 Posted : Thursday, September 28, 2017 11:24:43 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/24/2017(UTC)
Posts: 1
Location: United States of America

I'm using VS 2017 - 15.3.5 and getting code analysis errors across my solution even though code analysis is set to False in NCrunch settings.





How can I get the style rules to be ignored? I assume this is because Roslyn analyzers are embedded in the projects?

I also attempted to run under a different build configuration which explicitly excludes code analysis from the build - but ran into a separate set of issues doing that.

Ralf Koban
#2 Posted : Friday, September 29, 2017 8:41:10 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/19/2014(UTC)
Posts: 44
Location: Germany

Thanks: 4 times
Was thanked: 10 time(s) in 9 post(s)
Hi,

The easiest way is to edit your project file. Search for the location of the StyleCop analyzers add-in and add " Condition="'$(NCrunch)' != '1'" " to the <ItemGroup>

Eg.

<ItemGroup Condition="'$(NCrunch)' != '1'">
<Analyzer Include="..\Solution\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\Solution\packages\StyleCop.Analyzers.1.1.0-beta004\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>

Best regards,
Ralf
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.022 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download