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

Notification

Icon
Error

NCrunch refuses to run when dependent project uses .NET Standard and a test library
ClausAppel3Shape
#1 Posted : Thursday, March 26, 2020 12:45:17 PM(UTC)
Rank: Member

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

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

I had NCrunch running until recently. Then I deleted a bunch of local settings, and apparently I lost some NCrunch settings that were not checked into source control. Now NCrunch no longer runs in the given code base.

I get a number of warnings like this:

Quote:
MSB3243: No way to resolve conflict between "FsCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" and "FsCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<something-non-null>". Choosing "FsCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily.

... and a few more NuGets like this. I believe this is because I use the StrongNamer package to auto-generate strong names for NuGets that are not signed.

I believe this is fixable with the right NCrunch settings (since it worked yesterday), but I don't know which settings. Can anyone help?

Thanks in advance!


EDIT: I found out that the above is apparently not the real problem. The problem appears to be this:

* I have a test project, P1. It targets .NET Core 3.1.
* Test project P1 depends on test helper project P2. P2 does not contain tests, but it does have a reference to a test framework (Xunit).
* P2 targets .NET Standard 2.0.

Now NCrunch becomes sad. It marks P2 as "failed" because it can't run its tests (even though there are no tests in it), and hence NCrunch also refuses to run tests in other projects that depend on P2.

Workaround: Change P2 to dual-target .NET Standard 2.0 and .NET Core 3.1.

Is there a better way to fix this? Or can it be considered a bug in NCrunch?
Remco
#2 Posted : Thursday, March 26, 2020 10:54:54 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

When NCrunch detects your netstandard project as referencing Xunit, it considers it a test project. The easy solution here would be to go into your NCrunch configuration for this project and disable the Xunit adapter for the project. This will stop NCrunch from trying to discover tests in the project and prevent downstream issues.
1 user thanked Remco for this useful post.
ClausAppel3Shape on 3/27/2020(UTC)
ClausAppel3Shape
#3 Posted : Friday, March 27, 2020 7:15:43 AM(UTC)
Rank: Member

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

Thanks: 2 times
Was thanked: 2 time(s) in 1 post(s)
Remco;14557 wrote:
Hi, thanks for sharing this issue.

When NCrunch detects your netstandard project as referencing Xunit, it considers it a test project. The easy solution here would be to go into your NCrunch configuration for this project and disable the Xunit adapter for the project. This will stop NCrunch from trying to discover tests in the project and prevent downstream issues.

Thanks! Setting "XUnit v2+ Enabled" to false for these helper projects seems to resolve it. :)
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.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download