Build/Test Issues

NetStandard2.0 csproj referencing NUnit without tests

Started by GreenMoose on 5,214 views

[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?


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/documentation/considerations-and-constraints_netstandard-test-projects


Thanks.

Edited

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'.

Post a reply

Log in to reply.