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

Notification

Icon
Error

NCrunch fails to build a project when there's a file in it with long path
Xennan
#1 Posted : Wednesday, September 20, 2023 1:34:48 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/10/2023(UTC)
Posts: 2
Location: Netherlands

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Since about two months I have some projects that fail to build in NCrunch. They do build though from within Visual Studio or at the command line.
Those projects have one thing in common: they have one or more files with a path and name that exceeds 260 characters. Which is unexpected because these paths are this long for some years and this didn't give any problems. Also, long file path is enabled in Windows (in the registry, the LongPathsEnabled property in HKLM\System\CurrentControlSet\Control\FileSystem)

The error message is
"The file 'C:\<very long file name here>' could not be written to the workspace due to error:
System.IO.DirectoryNotFoundException: Could not find part of the path 'C:\Users\username\AppData\Local\NCrunch\20640\18\<very long file name here>'
at System.IO...
...
at nCrunch.Core.WorkspaceManagement.WorkspaceBuilder. (SnapshotComponentMember )
"

Any idea what could be the cause of this problem, and what could be the solution?
Remco
#2 Posted : Wednesday, September 20, 2023 11:54: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 issue.

The last time I checked, support for LongPathsEnabled is quite hit-and-miss in the underlying toolset, so this particular error can still happen.

The simple fix for this issue is to change your 'Workspace base path' setting to put it closer to the root of C: drive. Something like 'C:\Workspaces' should probably be enough.
1 user thanked Remco for this useful post.
Xennan on 9/21/2023(UTC)
Xennan
#3 Posted : Thursday, September 21, 2023 6:34:21 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/10/2023(UTC)
Posts: 2
Location: Netherlands

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi, thanks for your response. This fix worked for me.
1 user thanked Xennan for this useful post.
Remco on 9/21/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.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download