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

Notification

Icon
Error

Path too long error prevents project from building
James McAuley
#1 Posted : Wednesday, February 7, 2018 10:01:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/7/2018(UTC)
Posts: 1
Location: New Zealand

Thanks: 1 times
I get the following error message that prevents the project in question from building:

Code:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues
The file 'very long path' has a length that exceeds the 259 character limit when it is copied to the NCrunch workspace.  You can resolve this problem by either moving the file closer to its project root or by changing the NCrunch workspace base path to be closer to the root directory of your drive.
The file 'very long file path.sql' has a length that exceeds the 259 character limit when it is copied to the NCrunch workspace.  You can resolve this problem by either moving the file closer to its project root or by changing the NCrunch workspace base path to be closer to the root directory of your drive.


Obviously this refers to the dark old days of limited path lengths on Windows.

However now I have the following registry key enabled this restriction no longer applies.
Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled


Is it possible for NCrunch to allow long paths if it is enabled on the local machine?
Remco
#2 Posted : Thursday, February 8, 2018 1:03:50 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting.

I wasn't aware that this configuration setting existed. It looks like it was added in the early preview days of Windows 10, so I guess it's a few years old now.

The error message giving you trouble is caused by a check NCrunch does to ensure that constructed file paths in the workspace do not exceed the 259 character limit. This check was introduced many years ago (~2011 I think?) because when this limit was not respected we would see unpredictable downstream problems that would be much harder to track and sensibly report. The main problem being that though NCrunch could easily handle more than 259 characters, the multitude of O/S and CLR level IO calls used during a cycle of the NCrunch would not, and weird hangs and exceptions would be the result.

I've implemented a change in NCrunch that removes the check for the 259 character limit when the LongPathsEnabled registry key is set. Unfortunately, the results are not encouraging. MS still seem to be in the early days of introducing this support. A quick smoke test revealed many areas that become unstable or just completely don't work when the suppressed limit is exceeded. I think it will be a few years before we're able to build and execute our code from deeply nested directories.

I'll include the change in the next version of NCrunch for future proofing, but take my word for it: This won't solve your problem. I recommend moving your workspace closer to the disk root or reducing the length of the file names in your solution.
2 users thanked Remco for this useful post.
James McAuley on 2/8/2018(UTC), GreenMoose on 2/8/2018(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.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download