Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not write lines to file "obj\Debug\net5.0\SolutionName.GeneratedMSBuildEditorConfig.editorconfig exceeds the OS max path limit

I was doing a project, I runned 1 time and it was fine, I runned the second time and this error appeard "Could not write lines to file "obj\Debug\net5.0\SolutionName.GeneratedMSBuildEditorConfig.editorconfig exceeds the OS max path limit. The fully qualified file name must be less than 260 characteres. SolutionName C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.Managed.Core.targets 150".

So I did a little research and the most common response was to re-install visual studio, so i did, but the error continued. So i create a new program and without doing any changes, in the new program, the same erros ocurred. The only thing i have in this new program is the main class with an "Hello world".

I assume its not a code problem and i can't find anything that answers why this error is appearing.

like image 454
Rubs Bieira Avatar asked Mar 09 '21 17:03

Rubs Bieira


1 Answers

I have same error, and that is related with 'file name must be less than 260 characters' and resolved by Enabling Windows Long Path via reference link: https://www.microfocus.com/documentation/filr/filr-4/filr-desktop/t47bx2ogpfz7.html

or do the following steps:

1- Click Window key and type gpedit.msc, then press the Enter key. This launches the Local Group Policy Editor.

2- Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem.

3- Double click Enable NTFS long paths.

like this image

4- Select Enabled, then click OK.

5- at last restart visual studio

like image 59
Hamed Lohi Avatar answered Nov 11 '22 09:11

Hamed Lohi