Build/Test Issues

System.IO.PathTooLongException

Started by ewinhong on 3,976 views

Ncrunch console tool throws exception being too long

[PID:37976 14:55:48.9414 LocalBuildTask-43] ERROR (Internal): System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at nCrunch.Common.IO.FilePath.CopyTo(FilePath destinationPath, Boolean waitForLock)
at nCrunch.Core.ProjectItems.SnapshotComponentMember.WriteToFile(FilePath fileToWriteTo)
at nCrunch.Core.WorkspaceManagement.WorkspaceBuilder.(SnapshotComponentMember )
Hi,

This can happen if you have a solution with very long paths in it.

Try setting your workspace base path to be closer to the root of your disk.
Remco wrote:Hi,

This can happen if you have a solution with very long paths in it.

Try setting your workspace base path to be closer to the root of your disk.


that worked from visual studio. going to try ncrunch console to confirm.
This solution appears to no longer work. The current version of NCrunch is not allowing me to set paths outside of the default or Desktop directory/sub-directories.

Edited

erikgassler wrote:This solution appears to no longer work. The current version of NCrunch is not allowing me to set paths outside of the default or Desktop directory/sub-directories.


Can you describe in more detail what happens here? Does the UI prevent you from changing the setting? Or does the setting no longer have an effect on the engine behaviour?
The UI is limiting me to select from Desktop and any subfolders of Desktop, which I have discovered when OneDrive is enabled then I am essentially limited to OneDrive desktop. If I close OneDrive then Windows desktop appears to have access to select my C drive and its subfolders. This allowed me to set the desired C:/NCrunch folder to help with the path name lengths that break NCrunch testing.
I have not encountered any other applications in Windows that limit file/folder selection in this manner. It would be nice to have the option to just type/paste in an address to use.

Edited

erikgassler wrote:The UI is limiting me to select from Desktop and any subfolders of Desktop, which I have discovered when OneDrive is enabled then I am essentially limited to OneDrive desktop. If I close OneDrive then Windows desktop appears to have access to select my C drive and its subfolders. This allowed me to set the desired C:/NCrunch folder to help with the path name lengths that break NCrunch testing.
I have not encountered any other applications in Windows that limit file/folder selection in this manner. It would be nice to have the option to just type/paste in an address to use.


Thanks for sharing these details. The config setting just uses an O/S based dialog to select a directory on the machine. I guess this particular dialog is subject to change depending on what MS's priorities are at the time, so maybe it shouldn't be a surprise that OneDrive is being rammed through it. It IS possible to adjust the setting manually by changing the NCrunch config file under your user profile, or the NCrunch solution config file. I'll add a task to review how this dialog works to see if we can improve the experience here.

Post a reply

Log in to reply.