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

Notification

Icon
Error

Unable to run tests on clean install of VS 2026 Insiders
Tim Long
#1 Posted : Thursday, January 29, 2026 9:40:01 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 31
Location: United Kingdom

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Hi. I recently got a new computer and have done a clean install of all my tools, including VS2026 Insiders and NCrunch. Some of my projects build and run tests OK, but I have one problematic one that fails all tests (it was working on the old computer). I guess it's probably a missing dependency, but I'm not sure what. I've tried searching the NCrunch docs for "prerequisites" and can't find any mention. Here's the error:

Quote:
NCrunch encountered an error while trying to construct an environment to execute this test: 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.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:
Error:
An assembly specified in the application dependencies manifest (nCrunch.TaskRunner.DotNetCore.20.x64.deps.json) was not found:
package: 'System.Collections.NonGeneric', version: '4.3.0'
path: 'lib/netstandard1.3/System.Collections.NonGeneric.dll'


I can't work out what's causing this. I see that the error mentions both netstandard1.3 and DotNetCore.20, which isn't installed. Is this a prerequisite?
Remco
#2 Posted : Thursday, January 29, 2026 9:44:50 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 1014 times
Was thanked: 1360 time(s) in 1263 post(s)
Hi, thanks for posting.

NCrunch has a number of package dependencies that are needed by its test adapters. To avoid installer bloat, these aren't packaged with the product. Instead, when the engine is enabled, NCrunch does a scan of your Nuget packages cache and then it builds a small project containing the dependencies before running MSBuild to force them to restore.

Normally you'll get a warning or error if there's a dependency missing that it was unable to restore (before hitting the runtime failure you've experienced), but regardless the fix is the same. Try creating a small project in VS that references this specific version of the mentioned package. Then let the system restore it, and the problem should go away.
Tim Long
#3 Posted : Thursday, January 29, 2026 10:04:28 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 31
Location: United Kingdom

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Remco;18589 wrote:
Hi, thanks for posting.

NCrunch has a number of package dependencies that are needed by its test adapters. To avoid installer bloat, these aren't packaged with the product. Instead, when the engine is enabled, NCrunch does a scan of your Nuget packages cache and then it builds a small project containing the dependencies before running MSBuild to force them to restore.

Normally you'll get a warning or error if there's a dependency missing that it was unable to restore (before hitting the runtime failure you've experienced), but regardless the fix is the same. Try creating a small project in VS that references this specific version of the mentioned package. Then let the system restore it, and the problem should go away.


That doesn't appear to have worked, unfortunately. I added a class library project in the offending solution targeting net10.0 and manually added a reference to the allegedly missing NuGet package. The project builds, as does my test project, but all the tests are still throwing the same error. I tried disabling and re-enabling the engine, and restarting Visual Studio, etc. - just in case.
Remco
#4 Posted : Thursday, January 29, 2026 10:23:30 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 1014 times
Was thanked: 1360 time(s) in 1263 post(s)
Can you check the contents of your Nuget package cache to see if the package is installed in the expected location?

Normally the file should be at C:\Users\USER\.nuget\packages\System.Collections.NonGeneric\4.3.0\lib\netstandard1.3\System.Collections.NonGeneric.dll

If the binary is not there but the package directory is, try deleting C:\Users\USER\.nuget\packages\System.Collections.NonGeneric\4.3.0 and restoring it again.
Tim Long
#5 Posted : Thursday, January 29, 2026 10:38:21 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 31
Location: United Kingdom

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Remco;18591 wrote:
Can you check the contents of your Nuget package cache to see if the package is installed in the expected location?


Yes, it was there. I deleted it and re-restored anyway, no joy.

However, I noticed that the problem has now moved to a different package: 'System.Runtime.Loader', version: '4.3.0'
So I installed that, and the problem moved to: 'System.Runtime.Serialization.Formatters', version: '4.3.0'

It seems like there is some sort of systemic issue here, like nCrunch is trying to use a framework that's just not installed, not just the odd missing package.
Remco
#6 Posted : Thursday, January 29, 2026 11:02:44 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1014 times
Was thanked: 1360 time(s) in 1263 post(s)
There is a list of packages that NCrunch requires which it should automatically restore itself.

I think your Nuget package cache is corrupt. Try renaming the package root (with the IDE closed) to see if re-downloading the packages resolves the issue.
Tim Long
#7 Posted : Friday, January 30, 2026 12:15:29 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 31
Location: United Kingdom

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Remco;18595 wrote:
There is a list of packages that NCrunch requires which it should automatically restore itself.

I think your Nuget package cache is corrupt. Try renaming the package root (with the IDE closed) to see if re-downloading the packages resolves the issue.


It's not that. I've tried clearing the nuget cache, reinstalling NCrunch and Visual Studio. The reason I'm having this issue is that I've just started out with a clean slate on a new computer and something that nCrunch needs is missing. I've done several hours worth of troubleshooting myself and I'm really struggling with this. My AI suggested that I file the following report:

NCrunch Version: 5.20.0.2
Visual Studio Version: 2026
.NET SDK: 10.0.102

NCrunch is attempting to use nCrunch.TaskRunner.DotNetCore.20.x64
for projects targeting net8.0 and net10.0, resulting in missing
assembly errors like:
package: 'System.Collections.NonGeneric', version: '4.3.0'
path: 'lib/netstandard1.3/System.Collections.NonGeneric.dll'

The same test project works correctly for net481 target.

Test project configuration:
<TargetFrameworks>net481;net8.0;net10.0</TargetFrameworks>

Note that the solution builds and runs fine in Visual Studio. It's public if you'd like to check it out and have a look at my config: https://github.com/Tigra...lities/tree/feature/mvvm
Remco
#8 Posted : Saturday, January 31, 2026 11:55:07 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1014 times
Was thanked: 1360 time(s) in 1263 post(s)
Thanks for these extra details. Sorry about the frustration that I'm sure this has been causing you.

I'm wondering if you could check for me whether you are able to run NCrunch on a simple test project created from one of the standard VS templates that is targeting the same version of .NET and the same test framework? This will help to establish whether the issue is something related to your solution or whether it's tied to your system configuration.

Also it would be great if you could submit a bug report right after you've hit the failure. The log file in the report might yield some interesting information about what is happening on your system.
1 user thanked Remco for this useful post.
Tim Long on 2/2/2026(UTC)
Remco
#9 Posted : Monday, February 2, 2026 11:28:44 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 1014 times
Was thanked: 1360 time(s) in 1263 post(s)
Thanks for sending through the bug report. The report contains an error that should be showing up in your NCrunch tests window. The package names were duplicated in the error, so I fixed this manually:

ERROR: Unable to restore required Nuget packages for .NET Core test environment
NCrunch was unable to restore Nuget packages required to build a test environment for this solution, due to an error: The msbuild command returned exit code 1: "c:\program files\microsoft visual studio\18\insiders\MSBuild\Current\Bin\msbuild.exe" /t:Restore "C:\Users\Tim.Long\AppData\Local\NCrunch\53816\PackageRestore\restorePackages.csproj"

The following packages do not exist under the Nuget packages folder for the active user profile, yet they have been flagged by NCrunch as potentially needed for normal operation. NCrunch has attempted to restore these files via an MSBuild restore step, which has either failed or not returned the expected result. It's possible that these packages may not be needed for building projects or running tests in your environment. If you experience downstream problems with NCrunch on this solution, it is recommended you restore or download the packages manually.

Note that the restore of packages may fail if NCrunch is being hosted under a windows account that does not have sufficient rights to store files in the Nuget packages directory.

System.Collections.NonGeneric v4.3.0
Microsoft.NETFramework.ReferenceAssemblies.net20 v1.0.2
System.CodeDom v6.0.0
System.Collections.NonGeneric v4.3.0
System.Collections.Specialized v4.3.0
System.ComponentModel v4.3.0
System.ComponentModel.Primitives v4.3.0
System.ComponentModel.TypeConverter v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Management v6.0.0
System.Runtime.CompilerServices.Unsafe v6.0.0
System.Runtime.Loader v4.0.0
System.Runtime.Loader v4.3.0
System.Runtime.Serialization.Formatters v4.3.0
System.Runtime.Serialization.Primitives v4.3.0
System.Text.Encoding.CodePages v6.0.0
System.Threading.Thread v4.0.0
System.Threading.Thread v4.3.0
xunit.abstractions v2.0.3
xunit.runner.utility v2.4.1





... Basically some environments seem to have this problem. I haven't been able to reproduce it to understand why, but I think it's somehow related to security configuration. Make yourself a csharp project that references the specified versions of the above packages and let VS's package restore pull them down, and you should be up and running.
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.063 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download