-
Notifications
You must be signed in to change notification settings - Fork 169
Analyzer in 2.24.84 requires Roslyn 4.14.0, incompatible with .NET 8 SDK #1399
Description
Summary
StreamJsonRpc 2.24.84 ships a Roslyn analyzer (StreamJsonRpc.Analyzers.dll) in the analyzers/cs/ folder that references Roslyn compiler version 4.14.0.0. This is newer than the Roslyn compiler shipped with the .NET 8 SDK (version 4.11.0.0), which is still in LTS support until November 2026.
When a project that transitively references StreamJsonRpc 2.24.84 is built with the .NET 8 SDK and TreatWarningsAsErrors=true, this causes a build failure:
CSC : error CS9057: The analyzer assembly 'streamjsonrpc/2.24.84/analyzers/cs/StreamJsonRpc.Analyzers.dll'
references version '4.14.0.0' of the compiler, which is newer than the currently running
version '4.11.0.0'.
Impact
This affects any project that:
- References StreamJsonRpc 2.24.84 (directly or transitively)
- Builds with the .NET 8 SDK
- Has
TreatWarningsAsErrorsenabled
In our case (.NET Aspire), we ship NuGet packages (Aspire.Hosting, Aspire.Hosting.RemoteHost) that depend on StreamJsonRpc. Our customers who still use the .NET 8 SDK hit this error when building their projects. This prevents us from updating to StreamJsonRpc 2.24.x.
The previous version (2.22.23) did not have this issue.
Suggested fix
The analyzer should either:
- Be compiled against a Roslyn version that is compatible with the .NET 8 SDK (4.11.0 or earlier), or
- Ship multiple analyzer DLLs targeting different Roslyn versions (e.g.,
analyzers/cs/roslyn4.4/andanalyzers/cs/roslyn4.14/), or - Use the
roslyn4.xconvention in the package folder structure so the analyzer only loads on compatible SDKs
Environment
- StreamJsonRpc version: 2.24.84
- .NET SDK: 8.0.x (LTS, supported until November 2026)
- Roslyn version in .NET 8 SDK: 4.11.0.0
- Roslyn version required by analyzer: 4.14.0.0