"Could not find a part of the path" using VS 2022 msbiuld
See original GitHub issueWhen opening a solution with a long file path in VS Code using either VS 2022 msbuild or the standalone msbiuld the intellisense is broken.
The console app project will execute correctly when running dotnet run and VS 2022 correctly displays the solution.
I receive an error “Could not find a part of the path” in the omnisharp logs.
C# extension version v1.23.16
MS Build versions:
- Visual Studio Professional 2022 17.0.31825.309 17.0.0
- StandAlone 17.0.0
O/S: Windows 10 (21H1) Build 19043.1288
Log File: scratch2.txt
Reproducible solution: test-proj.zip
Logs of interest:
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\AlexBurgett\devel\temp\test-proj\src\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
Could not find a part of the path 'c:\Users\AlexBurgett\devel\temp\test-proj\src\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long\obj\Debug\net6.0\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long.GeneratedMSBuildEditorConfig.editorconfig'.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Users\AlexBurgett\devel\temp\test-proj\sr
c\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long.csproj'.
c:\Users\AlexBurgett\devel\temp\test-proj\src\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long.csproj
C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Roslyn\Microsoft.Managed.Core.targets(190,5): Error: Could not find a part of the path 'c:\Users\AlexBurgett\devel\temp\test-proj\src\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long\obj\Debug\net6.0\A.Really.Long.Long.Long.Long.Long.File.Path.That.Is.Really.Long.I.Mean.Really.Long.GeneratedMSBuildEditorConfig.editorconfig'.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:6
Top Results From Across the Web
Error Could not find a part of the path when build ...
I'd start by increasing the MSBuild project build output verbosity (under tools -> options -> projects and solutions -> build and run), building ......
Read more >Could not find a part of the path \roslyn\csc.exe
Anyone else getting the following issue on the lattest update of visual studio 2022 Could not find a part of the path ......
Read more >Visual Studio 2019: Failure: Could not find a part of the path
When I use vs2019 16.8.4 to build an application,vs2019 will prompt: Could not write to "obj\Debug".Could not find a part of the ...
Read more >GIT HUB example for ACS isnt working - Microsoft Q&A
Jul 13, 2022, 12:06 PM ... Error Could not find a part of the path ... Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn\Microsoft.
Read more >MSB3101: Could not write state file 'filename'. - MSBuild
Typical issues include: the path was too long, permission was denied to the folder, a file was locked by another process, or the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same issue, but I was able to fix it by enabling “long path support” in Windows 10: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
I had an issue that
.NETcan’t build the.editorconfigwith a long path file and this is helped