Could not write lines to file 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.

asked Mar 9, 2021 at 17:04

Could not write lines to file exceeds the OS max path limit

8

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.

Could not write lines to file exceeds the OS max path limit

4- Select Enabled, then click OK.

5- at last restart visual studio

answered Nov 30, 2021 at 8:51

Could not write lines to file exceeds the OS max path limit

Hamed LohiHamed Lohi

4424 silver badges11 bronze badges

2

I have also experienced a similar issue. I resolved it by moving my project to the root of my C: Drive to try and shorten the name and the path of the project.

Could not write lines to file exceeds the OS max path limit

Dharman

28k21 gold badges75 silver badges127 bronze badges

answered Apr 12, 2021 at 11:29

1

User710938911 posted

Hi All,

I am getting the following error from the Output window when I am trying to build one of the projects.

Project not selected to build for this solution configuration 

------ Build started: Project: Provider.Caching.BroadcastPollingCachingProvider.SQLDataProvider, Configuration: Debug Any CPU ------

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /baseaddress:5A20000 /nowarn:42016,42017,42018,42019,42032 /optioncompare:Binary /optionexplicit+ /optionstrict+ /removeintchecks- /doc:obj\Debug\DotNetNuke.Caching.BroadcastPollingCachingProvider.SQLDataProvider.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:"C:\Program Files\Projects\DotNetNukeAug2010\DotNetNuke.root\DotNetNuke\Website\bin\DotNetNuke.Caching.BroadcastPollingCachingProvider.dll","C:\Program Files\Projects\DotNetNukeAug2010\DotNetNuke.root\DotNetNuke\Library\bin\DotNetNuke.dll",..\..\..\..\..\Components\DataAccessBlock\bin\Microsoft.ApplicationBlocks.Data.dll,c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\DotNetNuke.Caching.BroadcastPollingCachingProvider.SQLDataProvider.dll /target:library /warnaserror- AssemblyInfo.vb SqlDataProvider.vb

Provider.Caching.BroadcastPollingCachingProvider.SQLDataProvider -> C:\Program Files\Projects\DotNetNukeAug2010\DotNetNuke.root\DotNetNuke\Website\bin\DotNetNuke.Caching.BroadcastPollingCachingProvider.SQLDataProvider.dll

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2809,9): error MSB3491: Could not write lines to file "obj\Provider.Caching.BroadcastPollingCachingProvider.SQLDataProvider.vbproj.FileListAbsolute.txt". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3041,9): error MSB3491: Could not write lines to file "obj\Provider.Caching.BroadcastPollingCachingProvider.SQLDataProvider.vbproj.FileListAbsolute.txt". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Done building project "Provider.Caching.BroadcastPollingCachingProvider.SQLDataProvider.vbproj" -- FAILED.

Any advice would be helpful. 

Thanks,

Vinay