Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#59 .NET Framework Unhandled Exception with long path files

open
nobody
None
5
2014-08-25
2012-09-18
No

See attached file and the following error.

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.

After this, the application closes and nothing has been synced, and the settings are lost.

Here's the full log:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
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.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.Path.GetFullPathInternal(String path)
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.IO.FileSystemInfo.get_FullName()
at FTPbox.Forms.fMain.LoadLocalFolders()
at FTPbox.Forms.fMain.CheckPaths()
at FTPbox.Forms.fMain.StartUpWork()
at FTPbox.Forms.fMain.fMain_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.269 (RTMGDR.030319-2600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
FTPbox
Assembly Version: 2.2.1.1
Win32 Version: 2.2.1.1
CodeBase: file:///C:/Program%20Files/FTPbox/FTPbox.exe
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.269 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.278 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.282 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Renci.SshNet
Assembly Version: 0.1.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/FTPbox/Renci.SshNet.DLL
----------------------------------------
Starksoft.Net.Ftp
Assembly Version: 1.0.158.0
Win32 Version: 1.0.158.0
CodeBase: file:///C:/Program%20Files/FTPbox/Starksoft.Net.Ftp.DLL
----------------------------------------
Starksoft.Net.Proxy
Assembly Version: 1.0.131.0
Win32 Version: 1.0.131.0
CodeBase: file:///C:/Program%20Files/FTPbox/Starksoft.Net.Proxy.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Regards,

Nika.

Discussion

  • JohnTheGr8
    JohnTheGr8
    2012-09-18

    Doing a quick Google search I found out that this is a Windows limitation.
    You can check under "Maximum Path Length Limitation" in the following link: http://msdn.microsoft.com/en-us/library/aa365247\(VS.85).aspx#maximum_path_length

    I will, however, take a look and see if I can find a workaround for this problem!

     
  • The workaround I did was manually. The initial 60 characters of my path are my backup folder and my userprofile (ie C:\Backup\LaptopName\Users\Username.Domainname\Documents). I substed that folder to my S-drive (subst S: FolderName) and then used the S-drive for the sync location instead...

     
  • Hi there, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam feedback? If so how do you reduce it, any plugin or anything you can suggest? I get so much lately it's driving me mad so any assistance is very much appreciated.
    Monster Beats http://www.shoppingbeatsbydrestudio.com/