Build/Test Issues

New csproj format with TargetFrameworks & one target causes NCrunch to fail to build

Started by DavidArnoDandG on 5,813 views

If I create a project with the following in the csproj file:
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.1</TargetFrameworks>
</PropertyGroup>

</Project>


the NCrunch fails to build the project, complaining:
System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file:
The target "_SplitProjectReferencesByFileExistence" does not exist in the project...


Changing "<TargetFrameworks>" to "<TargetFramework>" fixes the problem. As the latter is a better choice of tag, this is a minor issue. But I thought I'd report it as it took me a fair amount of time to work out why it wasn't building and could catch someone else out too.
Hi, thanks for sharing this problem.

Yes, unfortunately this gives a terrible error message. VS actually used to give the same message, but MS have fixed this now. There is a fix pending for this in the next version of NCrunch. Apologies if this has resulted in wasted time.

Post a reply

Log in to reply.