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

Notification

Icon
Error

NetStandard2.0 csproj referencing NUnit without tests
GreenMoose
#1 Posted : Wednesday, November 8, 2017 1:33:43 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
[3.11.0.9]

I use a netStandard2.0 library to be used by unit tests projects (of type netCore2.0).
This netStd library has some abstract base classses referencing NUnit to be reused in test projects, but no actual tests.

However NCrunch seems to refuse to build it with below reason. Is this intentional even though NCrunch shouldn't run any tests in it?

Quote:

An error occurred while analysing this project after it was built: NCrunch encountered an unexpected error occurred while building an environment to analyse an assembly: NCrunch cannot execute tests for this project because it is set to target a platform that NCrunch cannot build a runtime environment for. Please retarget this project to a supported runtime platform or disable the test framework through NCrunch project-level configuration. If you are trying to use NCrunch with a .NET Standard test project, please see http://www.ncrunch.net/d...tstandard-test-projects


Thanks.
Remco
#2 Posted : Wednesday, November 8, 2017 8:58:39 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

Because NCrunch's interaction with tests is indirect (through the framework), it needs to interrogate the framework before it can be sure that there are no tests in the project. It identifies the candidate for a test framework through its build dependency on NUnit.Framework.

To get rid of this message, under your project configuration, set 'NUnit 3+ Enabled' to 'False'.
1 user thanked Remco for this useful post.
GreenMoose on 11/8/2017(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.021 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download