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

Notification

Icon
Error

NCrunch has encountered an internal error: System.Exception: System.IO.PathTooLongException
TURNSKIN
#1 Posted : Wednesday, October 1, 2025 2:11:49 PM(UTC)
Rank: Member

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

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
After installing Visual Studio 2026 Insiders (or maybe it was before, not sure) I have started to get these errors:



When I try to run with Rider I get this error on building project:
Quote:

NCrunch: If you are experiencing problems in getting this project to build, have a look at https://www.ncrunch.net/...ng_project-build-issues
..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.Managed.Core.targets (191, 5): Could not find a part of the path 'C:\_NCrunchWorkspaces\23772\89\Projects\MyApplication.MyCalculations\MyApplication.MyConsolidation\MyApplication.MyConsolidation.Database.Migrations\obj\Debug\net9.0\MyApplication.MyConsolidation.Database.Migrations.GeneratedMSBuildEditorConfig.editorconfig'.


P.S. `LongPathsEnabled` is set to 1
Remco
#2 Posted : Wednesday, October 1, 2025 11:21:52 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 997 times
Was thanked: 1343 time(s) in 1246 post(s)
Hi, thanks for sharing this.

Unfortunately long path support is not reliable through the platform as a whole, so we have no way to fully support it under NCrunch.

I recommend moving your workspace closer to the disk root. Try changing your workspace base path (currently 'C:\_NCrunchWorkspaces') to something shorter, like 'C:\WS'.
1 user thanked Remco for this useful post.
TURNSKIN on 10/3/2025(UTC)
TURNSKIN
#3 Posted : Thursday, October 2, 2025 11:17:20 AM(UTC)
Rank: Member

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

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
I tried to move workspace closer to root, but still nCrunch console fail with similar error could not be processed because it exceeded the maximum allowed length of 259 characters.:

While nCrunch for Rider works OK.
Remco
#4 Posted : Thursday, October 2, 2025 12:11:15 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 997 times
Was thanked: 1343 time(s) in 1246 post(s)
Sorry to hear that.

In this case, the only option remaining is to try and find a way to reduce the length of the path. It looks like the main culprit is a temporary file being used by the build system under your 'obj' directory. Changing the intermediate output path for the project might allow you to set this at a higher level directory so it doesn't hit the path limit. Depending on the files involved, there may be build options available for suppressing them.

Another option could be to examine the project involved to see which files it references from further up in the directory structure. If you're able to eliminate upwards/sideways dependencies, NCrunch then doesn't need to pad out the directory inside a deeper structure. So for example, instead of:
\_n\48908\13\Projects\MyApplication.MyCalculations\MyApplication.MyConsolidation\MyApplication.MyConsolidation.DAL\

You could get:
\_n\48908\13\

The easiest way to find which files are causing this is to examine the contents of the workspace being built by NCrunch. Simply right click the project in the NCrunch Tests Window, then choose Advanced->Browse to workspace. The files underneath \_n\48908\13 can give some clue as to which files are causing the problem. Copying them into the project directory or moving them further down in the structure would help to collapse the workspace and reduce the length of the paths inside it.
1 user thanked Remco for this useful post.
TURNSKIN on 10/3/2025(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.100 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download