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

Notification

Icon
Error

TargetInvocationException Looping
Silvenga
#1 Posted : Thursday, January 2, 2020 4:46:19 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 40
Location: United States of America

Was thanked: 3 time(s) in 3 post(s)
Happy new years!

When modifying the csproj by hand (changing the TargetFrameworks property, e.g. removing netcoreapp3.0) NCrunch will loop with the following error (for all target frameworks):

Code:

NCrunch: This project was built on server '(local)'
NCrunch: The tests in this project were discovered on server '(local)'
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 'D:\Development\<removed>\tests\unit-tests\<removed>.Tests\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v3.0'. Ensure that restore has run and that you have included 'netcoreapp3.0' in the TargetFrameworks for your project.
   at nCrunch.Compiler.ComponentAnalysisContext.()
   at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
   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 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
   at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(EffectiveProcessorArchitecture , 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)


Performing a dotnet restore makes no impact. The only mitigation I've found is to completely restart the NCrunch engine.
michaelkroes
#2 Posted : Thursday, January 2, 2020 4:53:04 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 247
Location: Netherlands

Thanks: 109 times
Was thanked: 55 time(s) in 53 post(s)
Hi! Thanks for posting and a happy new year!

Would you mind trying the build posted in the last post on this thread: https://forum.ncrunch.ne...7-update.aspx#post14281
Silvenga
#3 Posted : Thursday, January 2, 2020 5:06:07 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 40
Location: United States of America

Was thanked: 3 time(s) in 3 post(s)
Thanks for the response!

I installed the new build, the looping is still occuring.

Partly related, I've noticed when adding a new target to a test project, that NCrunch doesn't run the tests under that target until I restart the NCrunch engine. I see the new project target being built, but there is no test node.
Remco
#4 Posted : Thursday, January 2, 2020 11:27:03 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 838 times
Was thanked: 1136 time(s) in 1062 post(s)
Thanks for sharing these problems. Would you mind copy/pasting the contents of your .csproj file to the forum? If you're concerned about placing it publicly, you can also send it through the NCrunch contact form.

NCrunch is reliant on VS to update the project assets json files when projects are changed, but sometimes this process doesn't work in the way we'd like it to. Does rebuilding your solution using VS then resetting NCrunch resolve the issue?
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.244 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download