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

Notification

Icon
Error

macOS and IpcConnectionClosedException
hhoangnl
#1 Posted : Tuesday, January 24, 2023 1:03:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/27/2017(UTC)
Posts: 6
Location: Netherlands

Was thanked: 3 time(s) in 2 post(s)
I tried running nCrunch 4.15.0.4 on the following setup:
- Macbook M1 Max
- macOS
- Parallels
- Windows 11 VM
- Visual Studio 2022 Community

I get the following error even with the simplest code possible:
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: The NCrunch task process failed to correctly initialise with the following exception: nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The NCrunch task process was unexpectedly terminated. For information on how to troubleshoot this problem, please see https://www.ncrunch.net/...inated-unexpected-error
at nCrunch.TaskRunner.Ipc.Fast.IpcReader.Initialise()
at nCrunch.TaskRunner.Ipc.Fast.IpcStream.Connect(String ipcName, Boolean isHost)
at nCrunch.TaskRunner.Ipc.Fast.FastIpcClient.Connect(String ipcName)
at nCrunch.Core.ProcessManagement.DefaultProcessLoader.ConnectToProcess(ExternalProcess externalProcess, ProcessLoadParameters parameters, Action`1 outOfBandMessageHandler)
at nCrunch.Core.ProcessManagement.ExternalProcessManager..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters , Boolean )


Code:
public class Test
{
    [Fact]
    public void Foo()
    {
    }
}
Remco
#2 Posted : Tuesday, January 24, 2023 11:47:26 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.

Can you clarify for me whether NCrunch itself is running inside the Win11 VM? We don't support macOS, but if you're in a VM running Windows, in theory it should work.

If you are inside the VM, could you submit a bug report after you've had this happen to you? The report contains a log that might yield the underlying error. I think there is an installable component that is missing on your system (probably a .NET SDK).
Remco
#3 Posted : Wednesday, January 25, 2023 12:31:39 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 for sending through the bug report. There is a rather interesting error in the log:

[PID:7380 00:45:43.5887 ProcessOutputRedirectionErr-35] Process 20700: Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'C:\Users\____\AppData\Local\NCrunch\7380\3\Test\bin\Debug\net6.0\nCrunch.TaskRunner.DotNetCore.20.x64.dll'. An attempt was made to load a program with an incorrect format.

Is this a 32-bit VM? Or are you working in a 32-bit environment? Usually this error is related to inconsistencies in build or host configuration in regards to CPU architecture.
hhoangnl
#4 Posted : Wednesday, January 25, 2023 10:08:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/27/2017(UTC)
Posts: 6
Location: Netherlands

Was thanked: 3 time(s) in 2 post(s)
Ah, I'm running Visual Studio Community 2022 (ARM 64-bit).

The nCrunch processes are running on x64 architecture, though (according to the Task Manager).
hhoangnl
#6 Posted : Wednesday, January 25, 2023 9:18:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/27/2017(UTC)
Posts: 6
Location: Netherlands

Was thanked: 3 time(s) in 2 post(s)
It does work with .NET Framework projects, though. Just not with .NET 6 and 7.
Remco
#5 Posted : Wednesday, January 25, 2023 10:34:18 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)
hhoangnl;16428 wrote:
Ah, I'm running Visual Studio Community 2022 (ARM 64-bit).


That would be it. Sorry, we haven't done any development or testing to support VS ARM.

There's a feature request for us to extend support for this platform if you'd like to add your voice to it: https://ncrunch.uservoice.com/forums/245203-feature-requests/suggestions/45942007-support-for-ncrunch-on-windows-arm.

hhoangnl
#7 Posted : Friday, January 27, 2023 3:51:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/27/2017(UTC)
Posts: 6
Location: Netherlands

Was thanked: 3 time(s) in 2 post(s)
I managed to get nCrunch working by setting the nCrunch configuration of the unit test project to x86.
Both the Autodetect and x64 values were causing the IpcConnectionClosedException.

Hope this helps others too.
1 user thanked hhoangnl for this useful post.
Remco on 1/27/2023(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.047 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download