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

Notification

Icon
Error

System.IO.PathTooLongException
ewinhong
#1 Posted : Tuesday, February 22, 2022 8:08:47 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/5/2016(UTC)
Posts: 14
Location: United States of America

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 )
Remco
#2 Posted : Tuesday, February 22, 2022 10:45:27 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
ewinhong
#5 Posted : Wednesday, February 23, 2022 1:51:15 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/5/2016(UTC)
Posts: 14
Location: United States of America

Remco;16012 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.
erikgassler
#3 Posted : Monday, December 19, 2022 4:24:36 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/24/2020(UTC)
Posts: 4
Location: United States of America

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.
Remco
#4 Posted : Monday, December 19, 2022 8:00:07 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
erikgassler;16387 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?
erikgassler
#6 Posted : Wednesday, December 21, 2022 3:51:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/24/2020(UTC)
Posts: 4
Location: United States of America

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.
Remco
#7 Posted : Wednesday, December 21, 2022 6:29:36 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
erikgassler;16391 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.
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.057 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download