I've noticed that when using net5 test projects which reference multi-targeted libraries (net472 & netstandard2.1), ncrunch chooses the incorrect version to make available. For me, this has led to type load exceptions as it tries to execute net framework code which doesn't work in net5, even though there's a net standard version available.
I've created a much simplified proof of concept to show this, at
https://github.com/richa.../Net5ncrunchProblemDemo
- Lib is a class library with <TargetFrameworks>net472;netstandard2.1</TargetFrameworks>. To check which version is in use, this uses conditional compilation to return a different string.
- Test is a net5.0 test project, with a project reference to Lib.
When run via ncrunch, the net472 version of Lib is supplied rather than the netstandard2.1 version, and the test fails. When run via dotnet test or using Visual Studio's test runners, the test passes. If the test project is changed to netcoreapp3.1, everything works as expected.
Tested on ncrunch 4.5 stable and the 4.6.0.1 version linked in another forum thread.
Regards,
Richard