You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MSBuild workspace fails to load projects using Central Package Management (CPM) #318
Projects using NuGet Central Package Management (CPM) via Directory.Packages.props fail to load in the Roslyn MSBuild workspace. The solution "loads" but all projects referencing CPM-managed packages report [Failure] diagnostics, resulting in zero code intelligence for affected files.
Environment
csharp-ls: 0.22.0
.NET SDK: 10.0.102
OS: Fedora Linux (x86_64)
Solution format: .slnx
Reproduction
Given a solution using CPM with Directory.Packages.props:
This is valid CPM configuration (dotnet build succeeds). However, csharp-ls reports:
msbuildWorkspace.Diagnostics: [Failure] Msbuild failed when processing the file
'MyProject.csproj' with message: The following PackageReference items cannot define
a value for Version: System.Reactive.Linq. Projects using Central Package Management
must define a Version value on a PackageVersion item.
And for dependent projects:
msbuildWorkspace.Diagnostics: [Failure] Msbuild failed when processing the file
'DependentProject.csproj' with message: MyProject does not provide an inclusive lower
bound for dependency System.Reactive.Linq. System.Reactive.Linq 3.0.0 was resolved instead.
Impact
All projects in the solution that reference CPM-managed packages (or depend on projects that do) fail to load. The solution appears to finish loading (Finished loading solution), but no diagnostics, symbols, or code intelligence are available for any file in the affected projects.
Steps to reproduce
Create a .NET solution with CPM enabled (Directory.Packages.props with ManagePackageVersionsCentrally)
Add a PackageVersion entry and reference it from a project without a Version attribute
Run csharp-ls --solution MySolution.slnx -l debug
Open a file from the project via textDocument/didOpen
Observe [Failure] diagnostics in the log and no publishDiagnostics for the file
Notes
This may be an issue in the Roslyn MSBuildWorkspace layer rather than csharp-ls itself. dotnet build uses the real MSBuild which handles CPM correctly; the Roslyn workspace loader may use a different code path.
Activity
razzmatazz commentedon Sep 6, 2026
Hey!
Sorry for getting here so late, but I was not able to replicate this with help from Claude:
Could you please provide any more details that may help replicating this issue: SDK version, platform, etc?
Add regression test for Central Package Management project loading
rcdailey commentedon Sep 7, 2026
I no longer have the time to look into this further. I'll go ahead and close the issue.