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

Notification

Icon
Error

IpcConnectionClosedException - JSON parsing exception occurred
stanac
#1 Posted : Saturday, September 13, 2025 2:03:45 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/7/2019(UTC)
Posts: 13
Location: Serbia

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Getting following error message for all test projects in a solution. URL in the message does not mention IpcConnectionClosedException.

Code:

NCrunch 5.18.0.2,
Visual Studio Community 2022 (64-bit) 17.14.14
xunit 2.9.3
xunit.runner.visualstudio 3.1.3


Code:

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/documentation/troubleshooting_process-terminated-unexpected-error
at nCrunch.TaskRunner.Ipc.Fast.IpcReader.Initialise()
at nCrunch.Core.ProcessManagement.DefaultProcessLoader.ConnectToProcess(ExternalProcess externalProcess, ProcessLoadParameters parameters, Action`1 outOfBandMessageHandler)
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.ProcessManagement.ExternalProcessManager.launchProcess(EffectiveProcessorArchitecture processorArchitecture, ProcessLoadParameters parameters, Boolean forceRedirectOutput)

The trace output for the process is as follows:
A JSON parsing exception occurred in [C:\Users\{username}\AppData\Local\NCrunch\14372\5\tests\{solutionName}.Analytics.Tests\bin\Debug\net9.0\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.dev.json], offset 0 (line 1, column 1): Invalid value.
A JSON parsing exception occurred in [C:\Users\{username}\AppData\Local\NCrunch\14372\5\tests\{solutionName}.Analytics.Tests\bin\Debug\net9.0\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json], offset 0 (line 1, column 1): Invalid value.
Invalid runtimeconfig.json [C:\Users\{username}\AppData\Local\NCrunch\14372\5\tests\{solutionName}.Analytics.Tests\bin\Debug\net9.0\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json] [C:\Users\{username}\AppData\Local\NCrunch\14372\5\tests\{solutionName}.Analytics.Tests\bin\Debug\net9.0\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.dev.json]


nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.dev.json file content:

Code:

{
"runtimeOptions": {
"configProperties": {
"System.GC.Concurrent": false,
"System.GC.Server": true
},
"additionalProbingPaths": [
"C:\\Users\\{username}\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\{username}\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
]
}
}



nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json file content:

Code:

{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "9.0.9"
}
}
}
Remco
#2 Posted : Sunday, September 14, 2025 2:05:38 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 995 times
Was thanked: 1338 time(s) in 1241 post(s)
Hi, thanks for sharing this issue.

The json here looks structurally correct and I can't see anything obviously wrong with what's specified. I think this might be an encoding issue.

What triggered this issue? Do you see if for every solution you use NCrunch on? Or just this one?
stanac
#3 Posted : Sunday, September 14, 2025 9:26:30 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/7/2019(UTC)
Posts: 13
Location: Serbia

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
You are right, JSON looks correct. The thing is, this is happening only on one PC, on another one NCrunch is working. If it means anything it is working on desktop and failing on laptop, not sure if performance of the hardware plays any role.

I have tried deleting local (as in dir where solution file is) ncrunch dir and app data dir, it didn't help.

Issue occurred during larger refactoring, first I didn't pay any attention to it, since the solution wasn't building at all, now the solution is building but this issue persists.
Remco
#4 Posted : Sunday, September 14, 2025 1:34:05 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 995 times
Was thanked: 1338 time(s) in 1241 post(s)
Does the problem happen for all solutions? Or just one?

Can you inspect the .json files with a hex editor to see whether they have a BOM?
stanac
#5 Posted : Sunday, September 14, 2025 2:44:26 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/7/2019(UTC)
Posts: 13
Location: Serbia

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Yes, the problem is present for all solutions on this PC.

3 json files in the app data dir \tests\{project}\bin\debug\net9.0 have BOM "EF BB BF".
Remco
#6 Posted : Sunday, September 14, 2025 11:54:10 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 995 times
Was thanked: 1338 time(s) in 1241 post(s)
Ok, we're making progress :)

NCrunch v5.17 included this change:
- Fixed some files being written in ASCII when they should be in UTF8. This should give better support for non-english environments and projects.

The change was intended to resolve some localization issues around files being written by NCrunch. It may have had an unintended side-effect of adding a BOM that .NET doesn't like. It's not clear to me why it's causing problems on this machine but not others. Would you mind rolling back to v5.16 to see if the problem goes away?
stanac
#7 Posted : Monday, September 15, 2025 7:45:07 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/7/2019(UTC)
Posts: 13
Location: Serbia

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
After rolling back to 5.16 issue is no longer present on one of the projects. On another I have

Code:

An error occurred while analysing this project after it was built: System.IO.FileNotFoundException: Could not load file or assembly 'xunit.runner.utility.netcoreapp10, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'. The system cannot find the file specified.
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.035 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download