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

Notification

Icon
Error

nCrunch.Common.UserException: Errors occurred while trying to load the project file
RyanSullivanNET
#1 Posted : Wednesday, April 29, 2026 4:27:37 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/12/2025(UTC)
Posts: 11
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
In some of my work projects (.NET 8 Asp.NET projects with .NET 8 xunit Test projects), NCrunch refuses to run unit tests, but I am able to run tests using the Test Explorer in Visual Studio 2022.

Here is some output from the NCrunch Diagnostic Output: (some parts will be redacted to prevent names from being shown)

[PID:23200 09:14:48.3861 InitialisationQueueTask-31] ERROR (Load): Error occurred during load of component at C:\REDACTED\REDACTED\REDACTED\REDACTED.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 targeting pack Microsoft.NETCore.App is not installed. Please restore and try again.
The targeting pack Microsoft.AspNetCore.App is not installed. Please restore and try again.
at nCrunch.Compiler.ComponentAnalysisContext.queryValuesFromMSBuild()
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.processCallMethodMessage(CallMethodMessage callMethodMessage)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator.readMessage(Byte[] returnedData)
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator.Invoke(String methodName, Object[] args)
at nCrunch.Compiler.RemoteBuildRunnerProxy.AnalyseComponentBuild(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.<>c__DisplayClass4_0.<AnalyseComponentBuildInExternalProcess>b__0(IRemoteBuildRunner remoteBuildRunner)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.executeTaskUsingExternalProcess(Action`1 task, EffectiveProcessorArchitecture processorArchitecture, GridClientId client, BuildSystemParameters buildSystemParameters, IList`1 customEnvironmentVariables, Nullable`1 taskId, GridClientDescription clientDescription, DotNetCoreSdkVersion dotNetCoreSdkVersion)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.analyseComponentBuild(EffectiveProcessorArchitecture buildProcessorArchitecture, String targetFrameworkForMSBuild)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, IDEVersion ideVersion, BuildEngineId buildEngineId, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFrameworkForMsbuild, String visibleTargetFramework)

I looked up the Microsoft.NETCore.App and Microsoft.AspNetCore.App NuGet packages (since the error message mentioned them), and they seem to be related to .NET Core? One of them has a most recent release of 2024 (not good), so I'm not going to add that NuGet package to my test project.

Some more info:
- I have had Visual Studio 2026 and .NET 10 installed since Nov 2025. I haven't noticed any problems since then.
- Prior to April 2026, all of the code repositories (10-15 that I support) on my machine were .NET 8 projects.
- Around the first half of April 2026, I used Visual Studio 2026 to update a couple code repositories to use .NET 10 and csharp v14, but not this one. I mention it, this problem (that I'm posting about) started happening around 1-2 weeks ago. It's the only thing that might have any time-correlation with NCRunch not working, other than I updated by NCrunch license and downloaded the most recent NCRunch version at that time too.
- I have re-run the NCRunch configuration, without accepting any previous configuration. No improvement.
- I have searched for a global.json for this code repository/solution, and didn't find any.
- I have clicked the Rebuild button (Restart the NCRunch engine, resynchronize with VS, and rebuild all projects [Reset]) in the NCrunch Tests many times, trying to wipe out any invalid previous problems/configurations. It hasn't helped.
- I have updated NuGet Package references to the latest.
- I have reviewed the Test csproj, and removed some clutter, and it looks simple/good to me. I'll include it below, with some REDACTIONs.

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<RootNamespace>REDACTED.Tests</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\REDACTED\REDACTED.csproj" />
</ItemGroup>

</Project>


I couldn't see an easy way to include my NCrunch configuration, so I didn't try to include that.

Ryan
Remco
#2 Posted : Wednesday, April 29, 2026 11:51:56 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1027 times
Was thanked: 1375 time(s) in 1276 post(s)
Hi Ryan,

Thanks for sharing this. The first thing I'd like to check here is whether this is related to a Build Sdk mismatch. There are situations that can cause this (notably around installation of preview tooling). Could you try adjusting the 'Build Sdk' NCrunch configuration setting to make sure that it is inline with the version of VS you're running? The errors that can come from a build SDK mismatch tend to get very weird like this. It might be worth trying a range of different options under this config setting to see if you notice any difference.
1 user thanked Remco for this useful post.
RyanSullivanNET on 4/30/2026(UTC)
RyanSullivanNET
#3 Posted : Thursday, April 30, 2026 4:03:57 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/12/2025(UTC)
Posts: 11
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Remco,

Thanks for your quick response.

Your suggestion was valuable.

In other code repositories the values _VS2026_ and _VS2022_ and _10.0.202_ and _8.0.420_ (the latter two being similar to what is found in the results of running "dotnet --list-sdks" in command line).

In the code repository where I was having this problem, the _VS2026_ and _VS2022_ values replicated the problem I reported previously. However, the values _10.0.202_ and _8.0.420_ worked in that project.

I was using Visual Studio 2022 in all of my attempts, not Visual Studio 2026 (even though that is installed).

It is nice to have NCrunch operational again in all repositories.

Thanks,

Ryan
1 user thanked RyanSullivanNET for this useful post.
Remco on 5/1/2026(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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download