I'm not able to get the NUnit solution to build with NCrunch. I wish I knew of a way to look into NCrunch's MSBuild logs the way I'm used to with msbuildlog.com, but I eventually pared it down to this repro: Wrong target framework chosen.zip
It looks like a netcoreapp2.0 project is referencing the other project's netstandard1.6 output rather than the netstandard2.0 output:
Class1.cs (4, 20): The type or namespace name 'ClassLibrary' could not be found (are you missing a using directive or an assembly reference?)
Thanks for sharing this problem. The sample solution was really useful in figuring this out quickly.
When a multi-targeted project is referenced by other projects of different target platforms, the nature of this reference becomes ambiguous. For example, it could be considered perfectly valid for a netcoreapp2.0 project to reference a netstandard1.6 project, or a netstandard2.0 project. Neither answer is 'wrong', though it's clear that there must be a precedence.
You've managed to find a situation where the precedence in resolving this reference is different under NCrunch to the standard VS tooling.
I have a fix pending to resolve this issue. Since we're expecting to release v3.15 this weekend, I'll push it out with the public release. If the public release gets held up, I'll get you a dev build instead :)
Just realized that <TargetFramework> in the thread title was eaten rather than escaped, sorry for the silly-looking title. 😛
Just tried 3.15 on the NUnit solution. Now all the netcoreapp2.0 projects are all building fine, but the netcoreapp1.1 projects all stopped building with messages like these:
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
They shouldn't be trying to reference the .NET Standard 2.0 reference assemblies. I'll try to create a small repro; let me know if you don't need it.
I feel bad; I probably should have taken you up on the dev build offer, just to give you the opportunity to squash all the bugs in one release.