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...
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...
- Launch the Local Group Policy Editor by clicking the Windows key and entering
gpedit.msc. - Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem.
- Double click Enable Win32 long paths.
- Select Enabled, then click OK.
- Finally, re-launch your Visual Studio & re-build the solution.
More information
For more information, refer to this Microsoft documentation and related articles.