System.IO.PathTooLongException Class

The exception that is thrown when a path or file name is longer than the system-defined maximum length.

See Also: PathTooLongException Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class PathTooLongException : IOException

Remarks

PathTooLongException uses the HRESULT COR_E_PATHTOOLONG, which has the value 0x800700CE.

If your code does not have System.Security.Permissions.FileIOPermissionAttribute.PathDiscovery permission, the error message for this exception may contain only file or directory names instead of full paths.

Full paths must not exceed 260 characters to maintain compatibility with Windows operating systems. For more information about this restriction, see the entry tp://go.microsoft.com/fwlink/?LinkID=163666 in the BCL Team blog.

Note:

This exception is not included in the tp://go.microsoft.com/fwlink/?LinkID=247912 or the Portable Class Library, but it is thrown by some members that are. To catch the exception in that case, write a catch statement for System.IO.IOException instead.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0