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

Notification

Icon
Error

NCrunch3.7 .Net Core error
kolhapuri
#1 Posted : Friday, May 05, 2017 2:41:05 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2017(UTC)
Posts: 4
Location: United States of America

I am having issues running the NCrunch Tool to build/run tests vs2017 .net core projects. Just running the tests in vs2017 everything is fine. But when I try to run it in a build environment it errors out. There was a resolution for a similar error in v3.6 but I have 3.7. Here are the details.




C:\Tools\NCrunchConsoleTool-new>ncrunch E:\Build\A1\work\202d6ccafe264bc4\src\dmi.checkbee.sln

NCrunch Console Tool v3.7.0.7
Copyright c 2010-2016 Remco Software Ltd
Usage of this tool is permitted only under the terms described in License.rtf



This product is licensed to xxxxxxxx

[09:29:06.7042-?-1] Initialising UI Services
[09:29:06.7702-?-1] NCrunch Services Initialised
[09:29:06.8372-?-1] Publishing Event: [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]]
[09:29:06.8382-?-1] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being published on thread CoreThread to subscriber: ClientSettingsBlock.
[09:29:06.8432-?-1] Publishing Event: [EngineModesChangedEvent]
[09:29:06.8482-Core-5] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being processed on Core thread with subscriber: ClientSettingsBlock.
[09:29:07.4213-Core-8] Loading NCrunch modules
[09:29:07.4283-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\Gallio\nCrunch.Module.Gallio.crunchmodule
[09:29:07.4393-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\MSpec\nCrunch.Module.MSpec.crunchmodule
[09:29:07.4423-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\MSTest\nCrunch.Module.MSTest.crunchmodule
[09:29:07.4453-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\NUnit\nCrunch.Module.NUnit.crunchmodule
[09:29:07.4493-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\NUnit3\nCrunch.Module.NUnit3.crunchmodule
[09:29:07.4563-Core-8] Loading module: C:\Tools\NCrunchConsoleTool-new\Modules\XUnit2\nCrunch.Module.XUnit2.crunchmodule
[09:29:09.6295-Core-8] Framework description manager has loaded data for 6 test frameworks
[09:29:09.7045-InitialisationQueueTask-17] Auto restoring NuGet packages for 'E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee\DMI.CheckBee.csproj'
[09:29:09.9395-InitialisationQueueTask-17] Loading project: E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee\DMI.CheckBee.csproj
[09:29:11.6737-InitialisationQueueTask-17] ERROR (Load): Error occurred during load of component at E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee\DMI.CheckBee.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.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 )
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)

[09:29:11.6897-InitialisationQueueTask-18] Auto restoring NuGet packages for 'E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee.Tests\DMI.CheckBee.Tests.csproj'
[09:29:11.9057-InitialisationQueueTask-18] Loading project: E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee.Tests\DMI.CheckBee.Tests.csproj
[09:29:11.9687-InitialisationQueueTask-18] ERROR (Load): Error occurred during load of component at E:\Build\A1\work\202d6ccafe264bc4\src\DMI.CheckBee.Tests\DMI.CheckBee.Tests.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.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 )
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)

[09:29:12.0047-Core-8] All projects have been loaded
[09:29:12.5252-?-1] Reporting engine execution results
[09:29:12.7562-?-1] Shutting down engine
[09:29:14.4611-?-1] Returning result: BuildFailure
Remco
#2 Posted : Friday, May 05, 2017 10:43:42 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 639 times
Was thanked: 744 time(s) in 709 post(s)
Hi, thanks for sharing this issue.

The '_SplitProjectReferencesByFileExistence' error usually appears when MSBuild fails to resolve the targets imported by the project. Because this is a .NET Core project, the imports tend to be behind the scenes rather than listed in the file itself.

Does this solution build on the machine running ncrunch.exe if you try to build it using command-line MSBuild? For example:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "E:\Build\A1\work\202d6ccafe264bc4\src\dmi.checkbee.sln"
kolhapuri
#3 Posted : Saturday, May 06, 2017 5:05:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2017(UTC)
Posts: 4
Location: United States of America

Yes it does. You can see the output here

https://pastebin.com/h9YqLAtJ
Remco
#4 Posted : Saturday, May 06, 2017 6:40:47 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 639 times
Was thanked: 744 time(s) in 709 post(s)
Thanks! A couple of things that will help to narrow this down, considering that the solution works when you use it in VS on your dev machine ...

- Can you check whether running the console tool against the working copy on your dev machine performs as expected, or whether this gives the same error as on your build machine?
- Assuming your build machine has VS installed, could you try opening the checked-out solution using NCrunch in VS on the build machine to see if it works there?
kolhapuri
#5 Posted : Saturday, May 06, 2017 2:11:17 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2017(UTC)
Posts: 4
Location: United States of America

Yes for both. Here is the output from running the tool against the solution on my dev m/c.

Running the tests on the build server(where the ncrunchtool fails) in VS2017 succeds. Do you want to see any particular log related to this?

*********************************************
NCrunch Console Tool v3.7.0.7
Copyright c 2010-2016 Remco Software Ltd
Usage of this tool is permitted only under the terms described in License.rtf



This product is licensed to

[10:59:32.974-?-1] Initialising UI Services
[10:59:33.0155-?-1] NCrunch Services Initialised
[10:59:33.053-?-1] Publishing Event: [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]]
[10:59:33.054-?-1] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being published on thread CoreThread to subscriber: ClientSettingsBlock.
[10:59:33.0586-?-1] Publishing Event: [EngineModesChangedEvent]
[10:59:33.0611-Core-5] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being processed on Core thread with subscriber: ClientSettingsBlock.
[10:59:33.4899-Core-8] Loading NCrunch modules
[10:59:33.4949-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\Gallio\nCrunch.Module.Gallio.crunchmodule
[10:59:33.5033-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\MSpec\nCrunch.Module.MSpec.crunchmodule
[10:59:33.5054-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\MSTest\nCrunch.Module.MSTest.crunchmodule
[10:59:33.5078-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\NUnit\nCrunch.Module.NUnit.crunchmodule
[10:59:33.5113-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\NUnit3\nCrunch.Module.NUnit3.crunchmodule
[10:59:33.5169-Core-8] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\XUnit2\nCrunch.Module.XUnit2.crunchmodule
[10:59:35.0367-Core-8] Framework description manager has loaded data for 6 test frameworks
[10:59:35.1427-InitialisationQueueTask-15] Auto restoring NuGet packages for 'C:\dev\checkbee\src\DMI.CheckBee\DMI.CheckBee.csproj'
[10:59:37.1117-InitialisationQueueTask-15] Loading project: C:\dev\checkbee\src\DMI.CheckBee\DMI.CheckBee.csproj
[10:59:44.5243-InitialisationQueueTask-14] Auto restoring NuGet packages for 'C:\dev\checkbee\src\DMI.CheckBee.Tests\DMI.CheckBee.Tests.csproj'
[10:59:47.299-InitialisationQueueTask-14] Loading project: C:\dev\checkbee\src\DMI.CheckBee.Tests\DMI.CheckBee.Tests.csproj
[10:59:48.5225-Core-8] All projects have been loaded
[10:59:48.724-Core-8] Queuing 9 tests for passive execution
[10:59:48.8405-LocalBuildTask-5] Building new workspace C:\Users\sbhujle\AppData\Local\NCrunch\53664\1 for component DMI.CheckBee in context of grid client (local)
[10:59:48.8535-Core-8] Queuing 9 tests for passive execution
[10:59:48.912-LocalBuildTask-5] Now building DMI.CheckBee
[10:59:49.0625-Core-17] Queuing 9 tests for passive execution
[10:59:52.1694-LocalBuildTask-5] Build was successful for C:\Users\sbhujle\AppData\Local\NCrunch\53664\1\DMI.CheckBee\bin\Debug\netcoreapp1.1\DMI.CheckBee.dll
[10:59:52.2179-LocalBuildTask-24] Building new workspace C:\Users\sbhujle\AppData\Local\NCrunch\53664\2 for component DMI.CheckBee.Tests in context of grid client (local)
[10:59:52.2339-LocalBuildTask-24] Now building DMI.CheckBee.Tests
[10:59:53.2214-LocalBuildTask-24] Build was successful for C:\Users\sbhujle\AppData\Local\NCrunch\53664\2\DMI.CheckBee.Tests\bin\Debug\netcoreapp1.1\DMI.CheckBee.Tests.dll
[10:59:54.172-LocalAnalysisTask-21] Calling into task runner to analyse target assembly: C:\Users\sbhujle\AppData\Local\NCrunch\53664\2\DMI.CheckBee.Tests\bin\Debug\netcoreapp1.1\DMI.CheckBee.Tests.dll
[10:59:54.39-LocalTestExecutionTask-22] Calling into task runner to run 8 tests:
DMI.CheckBee.Tests.CardHolder.CardHolderModuleTests+GetMethod.Should_return_success_even_when_the_request_is_not_authenticated
DMI.CheckBee.Tests.HeartBeat.AboutModuleTests+GetMethod.Should_fetch_about_information_from_the_heartbeat_service_and_return_the_response_json
DMI.CheckBee.Tests.HeartBeat.HeartBeatServiceTests.Should_return_valid_response
DMI.CheckBee.Tests.Infrastructure.RequestIdentifierHookupTests+InitializeMethod.Should_create_new_correlation_identifier_if_incoming_request_does_not_have_correlation_header
DMI.CheckBee.Tests.Infrastructure.RequestIdentifierHookupTests+InitializeMethod.Should_use_correlation_identifier_if_incoming_request_has_correlation_header
DMI.CheckBee.Tests.Workflow.TransitionProviderTests+GetNextActivityMethod.Should_return_activity_name_when_transition_is_found
DMI.CheckBee.Tests.Workflow.TransitionProviderTests+GetNextActivityMethod.Should_return_null_when_no_transition_is_found
DMI.CheckBee.Tests.Workflow.WorkflowTests+ExecuteActivitiesMethod.Should_assign_entity_info_timestamp_info_activity_name_before_storing_workflow_activity_result
[10:59:55.7014-Core-18] Successfully completed execution of 8 tests on local machine
[10:59:55.763-LocalTestExecutionTask-17] Calling into task runner to run 1 tests:
DMI.CheckBee.Tests.HeartBeat.AboutModuleTests+GetMethod.Should_return_success_even_when_the_request_is_not_authenticated
[10:59:55.8925-Core-14] Successfully completed execution of 1 tests on local machine
[10:59:58.9728-?-1] Reporting engine execution results
[10:59:59.1112-?-1] Shutting down engine
[10:59:59.1708-Core-42] Cleaning up workspace: C:\Users\sbhujle\AppData\Local\NCrunch\53664\2
[10:59:59.1887-Core-42] Cleaning up workspace: C:\Users\sbhujle\AppData\Local\NCrunch\53664\1
[11:00:01.3666-?-1] Returning result: OK
Remco
#6 Posted : Saturday, May 06, 2017 11:07:02 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 639 times
Was thanked: 744 time(s) in 709 post(s)
Thanks for the extra details. This has me quite confused, as the load/build operation of the console tool is identical to that of the VS addin. The only real differences between them are in the synchronisation system.

I wonder if this might be related to user accounts. Does the console tool run under a different user account on the build server? Is it possible that the user account it's under might have restricted access to areas of the file system? This might explain why it's unable to resolve critical build targets.

Something else to check is whether the console tool is using the correct version of VS/MSBuild. Try specifying '/VS 2017' on the command line when you run the tool on the server and see if this makes any difference.
kolhapuri
#7 Posted : Monday, May 08, 2017 1:29:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2017(UTC)
Posts: 4
Location: United States of America

Thanks for your help. This seems to have resolved itself which is unfortunate since we are not able to pinpoint exactly what was causing it. I washaving issues using ncrunch inside vs2017 on the build machine. Tried all the different things suggested on the ncrunch site. Nothing worked. So I uninstalled ncrunch and vs2017 and reinstalled them and that seems to have taken care of the issue. I attribute this issue to something that went wrong in the initial install.

Thanks
Remco
#8 Posted : Monday, May 08, 2017 10:53:00 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 639 times
Was thanked: 744 time(s) in 709 post(s)
kolhapuri;10355 wrote:
Thanks for your help. This seems to have resolved itself which is unfortunate since we are not able to pinpoint exactly what was causing it. I washaving issues using ncrunch inside vs2017 on the build machine. Tried all the different things suggested on the ncrunch site. Nothing worked. So I uninstalled ncrunch and vs2017 and reinstalled them and that seems to have taken care of the issue. I attribute this issue to something that went wrong in the initial install.

Thanks


Thanks for confirming the problem is gone. Considering the nature of this problem, I think it was related to the VS2017 install state. Probably there was a component missing or not correctly installed. I'm glad all is working now.
anagle
#9 Posted : Wednesday, May 10, 2017 9:47:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2017(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
I am also experiencing this issue. A reinstall of VS2017 and NCrunch did not resolve the issue.
Remco
#10 Posted : Wednesday, May 10, 2017 11:50:37 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 639 times
Was thanked: 744 time(s) in 709 post(s)
Hi, thanks for touching in and for sharing the sample solution. The problem in your case is being caused by the way the target frameworks are specified in your project file.

Try changing the following:

<TargetFrameworks>netcoreapp1.1</TargetFrameworks>

To:

<TargetFramework>netcoreapp1.1</TargetFramework>

Interestingly, this problem also existed in the earlier releases of VS2017. VS would bomb out if it tried to load a project with a single 'TargetFrameworks', since this tag was designed for multi-targeting. It looks as though MS have now fixed this problem somewhere above NCrunch's integration point, so now NCrunch fails but VS doesn't. I've implemented a workaround to this that will be in the next NCrunch release, but for the time being avoid specifying 'TargetFrameworks' with a single entry.
1 user thanked Remco for this useful post.
richarddezwart on 5/11/2017(UTC)
anagle
#11 Posted : Thursday, May 11, 2017 2:09:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2017(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
This fixed my issue and saved me a lot of time
1 user thanked anagle for this useful post.
Remco on 5/11/2017(UTC)
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.117 seconds.