Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Projects using NuGet v3 do not build in NCrunch, error about global.json
jnm236
#1 Posted : Tuesday, February 9, 2016 6:27:01 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2015(UTC)
Posts: 57
Location: United States of America

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Because NuGet packages are coming out that make the old NuGet v2 (packages.config) much less desirable to use than the NuGet v3 (project.json) system, we migrated our projects. (See Project.json all the things by Oren Novotny.)

Project.json has been supported in Visual Studio 2015 Update 1 for .NET Framework 4.x since the end of November last year, and we have been delighted to find out that NuGet v3 resolves a host of issues we had had to work around with v2.

However, NCrunch seems to be making an incorrect assumption about projects that have a project.json. It refuses to build them, saying it can't find global.json. This should not be an issue; they are legal projects, supported in Visual Studio and TFS build, and build fine.

We are targeting 4.5.2, not .NET Core, and these are Windows Forms and WPF applications, not ASP.NET applications. Rather than complaining that global.json does not exist, NCrunch should realize these are not DNX projects and simply run these projects as it has always run them. How soon can this be fixed so that we can use NCrunch, and is there a workaround for the time being?


As a workaround I tried adding a global.json file; the next error was a NullReferenceException on nCrunch.Compiler.DnxIntegration.GlobalJson.get_RuntimeVersion().
I added { "sdk": { "version": "1.0.0-rc1-update1" } } and the next error is "Unable to find the DNX runtime library expected at 'C:\Users\jmusser\AppData\Local\NCrunch\10220\dnx_x86.1.0.0-rc1-update1\bin\Microsoft.Framework.Runtime.dll'. Your DNX runtime installation is either corrupt or is not supported by this version of NCrunch." Fresh install, definitely not corrupt.

I'm pretty sure winforms and WPF will not run on DNX anyway, so this seems to be a dead end.



project.json:
Code:
{
    "frameworks": {        
        "net452": { }
    },
    "runtimes": {
        "win": { }
    }
}



NCrunch window:

Quote:

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: Unable to resolve the global.json file from 'C:\Users\jmusser\Source\Workspaces\HeritagePMS\Heritage'. This file is required to be in a parent directory of the project being built.
at nCrunch.Compiler.DnxIntegration.GlobalJson.(DirectoryPath )
at nCrunch.Compiler.DnxIntegration.GlobalJson..ctor(DirectoryPath projectJsonDirectory)
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture buildProcessProcessorArchitecture, DirectoryPath workspaceBasePath)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.[T](Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture buildProcessProcessorArchitecture, DirectoryPath workspaceBasePath)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture processorArchitecture, VisualStudioVersion vsVersion, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.(ProcessorArchitecture )
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(FilePath projectFilePath, BuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, ISnapshotConfig snapshotConfig, VisualStudioVersion vsVersion)
Remco
#2 Posted : Tuesday, February 9, 2016 9:51:21 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

Thanks for sharing this issue.

During the first round of integration with DNX early last year, NCrunch was rigged to detect DNX projects through the presence of the project.json file. At the time, this was a safe assumption as DNX projects were the only ones making use of this system.

Much has changed since then. Now the presence of this file causes NCrunch to falsely assume that certain projects are DNX projects when actually they aren't.

I am not aware of any workaround for this problem other than avoiding the use of tools that require project.json. This will need to be addressed with an urgent fix to NCrunch. Thanks for making me aware of it.
Remco
#3 Posted : Wednesday, February 10, 2016 12:44:05 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
1 user thanked Remco for this useful post.
jnm236 on 2/10/2016(UTC)
jnm236
#4 Posted : Wednesday, February 10, 2016 1:07:16 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2015(UTC)
Posts: 57
Location: United States of America

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Installed NCrunch_VS2015_2.20.0.3.msi, everything works as expected. Thanks for the amazing turnaround time!
1 user thanked jnm236 for this useful post.
Remco on 2/10/2016(UTC)
Remco
#5 Posted : Monday, March 21, 2016 2:15:33 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
For anyone interested, v2.20 has just been fully released - http://www.ncrunch.net/download.
jnm236
#6 Posted : Monday, March 21, 2016 12:24:02 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2015(UTC)
Posts: 57
Location: United States of America

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Good to know!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.056 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download