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

Notification

Icon
Error

Using NCrunch, FxCop Analyzers and “warnings as errors”: How to configure warning severity?
ClausAppel3Shape
#1 Posted : Thursday, November 21, 2019 1:27:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2019(UTC)
Posts: 2
Location: Denmark

Thanks: 1 times
Was thanked: 2 time(s) in 1 post(s)
Hi!

I have NCrunch 3.26.0.4. I have <WarningsAsErrors /> set in my CSPROJ files (new CSPROJ format). I want to use FxCop Analyzers as NuGet packages: https://docs.microsoft.c...-analyzers?view=vs-2019

When I first installed the FxCop Analyzers, my code would not build because there were a number of warnings and I have <WarningsAsErrors />. I've downgraded a bunch of warnings to "suggestion" level by adding this to my .editorconfig:

Code:
dotnet_diagnostic.CA2100.severity = suggestion


Now I can build in Visual Studio. But my problem is that NCrunch evidently does not read the .editorconfig file. So NCrunch fails to build the solution because it sees warnings.

How can I configure warning severity levels for NCrunch?

(Also posted on Stack Overflow.)

Thanks in advance!
Remco
#2 Posted : Thursday, November 21, 2019 11:09:07 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,869

Thanks: 763 times
Was thanked: 980 time(s) in 933 post(s)
Hi, thanks for posting.

It's possible that NCrunch just isn't copying the .editorconfig file into the workspace used for building your project. Do you have this file included in your .csproj? If not, does including it make any difference?
2 users thanked Remco for this useful post.
ClausAppel3Shape on 11/22/2019(UTC), UppSol on 11/22/2019(UTC)
ClausAppel3Shape
#3 Posted : Friday, November 22, 2019 7:55:56 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/21/2019(UTC)
Posts: 2
Location: Denmark

Thanks: 1 times
Was thanked: 2 time(s) in 1 post(s)
Remco;14117 wrote:
It's possible that NCrunch just isn't copying the .editorconfig file into the workspace used for building your project. Do you have this file included in your .csproj? If not, does including it make any difference?

Thanks for the advice! You're right. I had my .editorconfig just as a "solution item". So I did this for each project:

1. Right-click project in Solution Explorer.
2. Select Add -> Existing file.
3. Select the .editorconfig file. Do not click "Add".
4. Click the arrow next to "Add" and select "Add as link".

Repeat for all projects, then restart NCrunch engine. Now NCrunch builds.

Woo! :D
2 users thanked ClausAppel3Shape for this useful post.
UppSol on 11/22/2019(UTC), Remco on 11/22/2019(UTC)
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.033 seconds.