Skip to content

"Could not find a part of the path" using VS 2022 msbiuld #2261

@aburgett87

Description

@aburgett87

When 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:

  1. Visual Studio Professional 2022 17.0.31825.309 17.0.0
  2. 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'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions