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

Notification

Icon
Error

IpcConnectionClosedException: The connection has been closed
TURNSKIN
#1 Posted : Tuesday, November 26, 2019 2:00:33 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/31/2015(UTC)
Posts: 18
Location: Lithuania

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Hi,
After migrating from dotnet core 2.2 to 3.0 our team started to get this error:

Quote:
An error occurred while analysing this project after it was built: NCrunch encountered an unexpected error occurred while building an environment to analyse an assembly: nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client)
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.(Nullable`1 , FilePath , GridClientId , CustomVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.LoadTestRunnerProcessForProjectReturningProcessId(SnapshotComponent snapshotComponent, IList`1 componentsInProcess, TestFrameworkDescription[] testingFrameworks, Nullable`1 newProcessTag, FilePath solutionFilePath, GridClientId client, CustomVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()



Reproduced with dotnet core 3.1 (same issue with 3.0):
https://github.com/PavelA85/nCrunchReporduce

NCrunch latest version
Visual studio 2019

Any way to fix this issue?
Remco
#2 Posted : Tuesday, November 26, 2019 10:35:40 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue. I've reproduced it using your sample and concluded that it seems to be triggered by the specification of a win10-x64 RuntimeIdentifier in the targeted project.

I'm not yet sure why this is the case. We're going to need to do more digging. We'll let you know when we have a solution available.
1 user thanked Remco for this useful post.
TURNSKIN on 11/28/2019(UTC)
dauciunas
#3 Posted : Thursday, November 28, 2019 11:06:26 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/28/2019(UTC)
Posts: 1
Location: Lithuania

I'm also having the same issue.
any ideas or suggestions or temporary workarounds would be most welcome!
tekavec
#4 Posted : Sunday, December 1, 2019 7:28:44 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/1/2019(UTC)
Posts: 2
Location: Slovenia

Was thanked: 1 time(s) in 1 post(s)
The same here - I have NUnit test project targeting netcoreapp3.0, RuntimeIdentifier= win-x64 and Microsoft.NET.Test.Sdk = 16.4.0.

I'm using NCrunch 4.1.0.1.

Please could you notify me when a fix is available.

Many thanks!
Tomaz
Remco
#5 Posted : Monday, December 2, 2019 2:55:36 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
TURNSKIN
#6 Posted : Monday, December 2, 2019 7:58:18 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/31/2015(UTC)
Posts: 18
Location: Lithuania

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
Hi,
thank you for update.
I am still getting error in my production solution.
output:


We found workaround for now:
Code:
<RuntimeIdentifier Condition="'$(Configuration)'=='Release'">win10-x64</RuntimeIdentifier>

We use conditional RuntimeIdentifier, that is applied only in CI pipeline
TURNSKIN
#7 Posted : Monday, December 2, 2019 8:05:21 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/31/2015(UTC)
Posts: 18
Location: Lithuania

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
When I migrated my production solution to dotnet core 3.1 I get this error:


Code:

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 FrameworkReference 'Microsoft.NETCore.App' was not recognized
The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
   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)

Remco
#8 Posted : Tuesday, December 3, 2019 12:42:24 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
We've updated NCrunch with some better handling of the new implicit framework references that were introduced in .NET Core 3.0 (this fix didn't get included in the build published above). It's worth trying this build to see if it resolves both of the problems you're experiencing:

NCrunch_Console_4.2.0.4.msi
NCrunch_Console_4.2.0.4.zip
NCrunch_GridNodeServer_4.2.0.4.msi
NCrunch_GridNodeServer_4.2.0.4.zip
NCrunch_LicenseServer_4.2.0.4.zip
NCrunch_VS2008_4.2.0.4.msi
NCrunch_VS2010_4.2.0.4.msi
NCrunch_VS2010_4.2.0.4.zip
NCrunch_VS2012_4.2.0.4.msi
NCrunch_VS2012_4.2.0.4.zip
NCrunch_VS2013_4.2.0.4.msi
NCrunch_VS2013_4.2.0.4.zip
NCrunch_VS2015_4.2.0.4.msi
NCrunch_VS2015_4.2.0.4.msi.7z
NCrunch_VS2015_4.2.0.4.zip
NCrunch_VS2017_4.2.0.4.msi
NCrunch_VS2017_4.2.0.4.msi.7z
NCrunch_VS2017_4.2.0.4.zip
NCrunch_VS2019_4.2.0.4.msi
NCrunch_VS2019_4.2.0.4.msi.7z
NCrunch_VS2019_4.2.0.4.zip

Assuming this doesn't work, is there any chance you could extract a particular file for me from the 3.0 failure and submit it through the NCrunch contact form? Right-click on the failing project, go to Advanced and choose to browse to the workspace. Find the bin\debug folder (or your build output directory), then look for a file called nCrunch.TaskRunner.DotNetCore.20.x64.deps.json. This file contains the dependency data for your test environment and lately it's been the cause of these exceptions under .NET Core 3.0. If I can have a copy of this file there's a good chance I can establish the source of the failure.

Regarding the .NET Core 3.1 issue ... We haven't done much in the way of testing with this framework yet, though it's still our goal to resolve issues encountered with it. The problem in this case looks like it might have a wider scope than NCrunch. Can you confirm that the project builds successfully using Visual Studio and MSBuild? I might need to get a code sample that can reproduce the issue if you're able to construct one. The problem is almost certainly dependency related and probably doesn't require any of your actual source code.
TURNSKIN
#9 Posted : Wednesday, December 4, 2019 8:17:19 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/31/2015(UTC)
Posts: 18
Location: Lithuania

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
By mistake I intalled NCrunch_Console_4.2.0.3.msi instead of NCrunch_VS2019_4.2.0.3.msi
I have installed NCrunch_VS2019_4.2.0.3.msi and it works as expected, projects with
Quote:
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>

are build as expected.

I will install NCrunch_VS2019_4.2.0.4.msi and get back if any issue is found.
TURNSKIN
#10 Posted : Wednesday, December 4, 2019 9:01:51 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/31/2015(UTC)
Posts: 18
Location: Lithuania

Thanks: 6 times
Was thanked: 2 time(s) in 2 post(s)
After intalling 4.2.0.4 build started to fail again with message:
Quote:
..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (263, 5): The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (263, 5): The FrameworkReference 'Microsoft.NETCore.App' was not recognized


WARNING - ..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (39, 5): NETSDK1086: A FrameworkReference for 'Microsoft.NETCore.App' was included in the project. This is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs
WARNING - ..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (39, 5): NETSDK1086: A FrameworkReference for 'Microsoft.NETCore.App' was included in the project. This is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs
WARNING - ..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (39, 5): NETSDK1086: A FrameworkReference for 'Microsoft.AspNetCore.App' was included in the project. This is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs
WARNING - ..\..\..\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (39, 5): NETSDK1086: A FrameworkReference for 'Microsoft.AspNetCore.App' was included in the project. This is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs

Output folder (bin\Debug\netcoreapp3.0\win10-x64) for failed project is empty
I have submitted some dep.json files via form.
Remco
#11 Posted : Wednesday, December 4, 2019 11:05:48 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks! We'll take a look at this and will get back to you.
keith
#12 Posted : Saturday, January 11, 2020 6:07:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/24/2013(UTC)
Posts: 9
Location: Australia

Was thanked: 1 time(s) in 1 post(s)
Hello,

I got the same error as in the original post after trying to build some existing code on a new machine for the first time. The solution built fine in Visual Studio but NCrunch was unable to build it.

Turns out the issue was that I didn't have the required .NET SDK installed on the machine. I'd just done a fresh install of VS 2019 but needed to also install (in my case) the .NET Core 2.2 SDK as this is the one our project was targeting.

Strange that VS could build it and NCrunch couldn't - but installing the SDK fixed it..

https://dotnet.microsoft.com/download/dotnet-core

Hope it helps someone.
Remco
#13 Posted : Saturday, January 11, 2020 8:24:29 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks Keith. I can offer some explanation for why NCrunch gave this error but VS didn't.

The error is a generic exception thrown for when the task runner .EXE just disappears without any reason or error given. There are a multitude of things that can cause this. In the case of .NET Core, the error usually appears when NCrunch is trying to build a runtime environment for the specified framework. NCrunch has actually built your project just fine, the error likely appeaedr when it tried to launch an environment to discover your tests - which won't be something that VS does at build time.
tekavec
#14 Posted : Sunday, January 12, 2020 3:12:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/1/2019(UTC)
Posts: 2
Location: Slovenia

Was thanked: 1 time(s) in 1 post(s)
I've tested the same solution that had issues with the latest 4.2.0.7 version and can confirm it solves the problem.

Thanks a lot, guys!

Tomaz
1 user thanked tekavec for this useful post.
Remco on 1/12/2020(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.553 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download