Show / Hide Table of Contents

Resolving Errors with Long File Names

Errors with "exceeding the max path limit" in Visual Studio

When working with large code respositories that have deep file structures, you may encounter errors similar to that displayed in the below image...

Error message associated with file names being too long.

If you encounter this error, follow the provided steps to enable "Windows Long Path", which increases your max path limit from 260 characters to 32,767 characters.

Note

It is also recommended that you clone repositories to a "short root directory", such as C:\dev\ .

Steps to enable "Windows Long Path"

To enable "Windows Long Path", follow these 5 simple steps...

  1. Launch the Local Group Policy Editor by clicking the Windows key and entering gpedit.msc.
  2. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem.
  3. Double click Enable Win32 long paths.
  4. Select Enabled, then click OK.
  5. Finally, re-launch your Visual Studio & re-build the solution.

More information

For more information, refer to this Microsoft documentation and related articles.

  • Improve this Doc
In This Article
Back to top Generated by DocFX