Build/Test Issues

NCrunch fails to build a project when there's a file in it with long path

Started by Xennan on 2,120 views

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?

Edited

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.
Hi, thanks for your response. This fix worked for me.
This post has been deleted.
This post has been deleted.

Post a reply

Log in to reply.