Build/Test Issues

Ensure that restore has run and that you have included 'netcoreapp2.0'

Started by IanBowyer on 11,050 views

Hi

I am having problem setting up ncrunch on a new project.

I have setup a new solution which is a dotnet core 2.0 web api
I have created a test project which only has a test in with "Assert.Pass" but as NCrunch is initialising it shows a load status of "Load Failure" with the following message in the description

"Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project."

I have checked that the projects are using netcoreapp2.0 and also the project.assets.json


Here is the full exception

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:
Assets file 'C:\Users\ian\Source\ic8-cloud\ic8-cloud\Ic8.Cloud.EndpointTests\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.
at nCrunch.Compiler.RemoteBuildRunner.(FilePath , LoadTimeQuery , String , String , DirectoryPath , String , String )
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- 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.(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(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , FilePath , String , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(ProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, VisualStudioVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFramework)


Any ideas what I am missing?

Hi, thanks for sharing this issue.

This can happen sometimes if the underlying platform gets itself in a bind and ends up out of sync. Try the following:

1. Close all instances of VS
2. Remove the contents of your 'bin' and 'obj' directories in ALL related projects
3. Restart VS and open the solution
4. VS should perform a package restore and regenerate the project.assets.json file
5. Start NCrunch. Hopefully things should work now
I tried the above and had no luck...

I was using an old version so I decided to try the 30 day trial of the latest version, which worked ok.

I have updated to the latest version and all is working ok now :)
IanBowyer wrote:
I was using an old version so I decided to try the 30 day trial of the latest version, which worked ok.


Ahh, that makes sense. .NET Core has been moving very quickly, so I definitely recommend keeping your NCrunch updated if you're working on this platform. Thanks for taking the time to confirm that the problem is solved for you :)

Edited

Post a reply

Log in to reply.