I initially had issues with MethodNodFoundException in NCrunch which is why I originally wrote the post (with dotnet test it was "could not find dll"), but that was due to use of different versions of a nuget package but led me to wonder if global.json was used.
Anyhow, I did a quick test and NCrunch does indeed copy the global.json to workspace folders.
However, if using a SDK version in it that does not exist NCrunch throws a pretty cryptic exception, but at least it fails which I would expect :).
dotnet build error:
Quote:
dotnet : A compatible SDK version for global.json version: [2.0.801] from [D:\TeamCity\buildAgent\work\cd4ee94462cc9ad\global.json] was not found
+ CategoryInfo : NotSpecified: (A compatible SD...] was not found:String) [],
NCrunch error:
Quote:
Utils.Common.Tests.NUnitTests.csproj: 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.
at nCrunch.Compiler.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
Thanks.