Skip to content

Long Path Support in ILSpy

Siegfried Pammer edited this page Jun 16, 2022 · 3 revisions

Ever since v7.2-preview1 ILSpy has had support for long paths in Windows 10 iff a certain registry key was set. With our recent move to .NET 6.0 for ILSpy 8, we discovered that .NET internally converts paths to kernel path syntax, which do not have the same restrictions as "user space" paths. This works even without setting the registry key in Windows 10. Another reason was recent customer feedback that we were truncating file names of resources, which would be a breaking change, if the resources were loaded by filename.

Known Issues

  • The only restriction that remains is that one "segment" (i. e., file or folder name) must not exceed 255 characters, this is an issue at file-system level and the same for all commonly used operating systems.
  • ILSpy and other applications based on newer (.NET Core+) versions of .NET will benefit from this internal path syntax conversion automatically, however, other applications might have problems dealing with long paths. Because of this it is strongly advised to set the LongPathsEnabled registry key in Windows 10 and later. As far as we know, Windows 11 still does not come with Long Path Support on by default.
  • Visual Studio does not support projects that use files with long path names. If you want this to change, please vote and or comment here: https://developercommunity2.visualstudio.com/t/file-path-too-long/654656