Thanks for the quick response, Remco :)
Remco;9933 wrote:The problem you're likely facing is that NCrunch isn't able to work with projects set to target multiple frameworks at the same time.
These projects were indeed multitargeting different frameworks, so I've just gone through the solution and removed all multitargeting from all the projects. However, the error seemed persistent, even after deleting all the NCrunch files in my working copy (The _NCrunch_Solution directory, all the .ncrunchsolution and .ncrunchproject files, and all the .ncrunch*.user files too).
I tried NCrunch out on a brand new solution, and obviously it worked just fine, but when I copy-pasted the contents of one of the project files exhibiting this error into one of my brand new project files, suddenly I started seeing the error in that project too. Paring the project file back to the barest minimum code didn't resolve the problem, and I couldn't see anything in the following that would cause this error:
Code:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
</PropertyGroup>
</Project>
It turned out the problem was that I needed to change TargetFrameworks to TargetFramework. It's interesting that this only causes a build error in NCrunch, and not in VS or the dotnet CLI tool. Might it be possible to catch this error and provide some guidance to the user on how to resolve it, or handle the situation more gracefully, like VS and dotnet CLI do?