Skip to content

Pin Sharprompt.SourceGenerator to Roslyn 4.11 for .NET 8/9 SDK compatibility#349

Merged
shibayan merged 2 commits intomasterfrom
copilot/fix-compatibility-for-dotnet-8-9
Apr 14, 2026
Merged

Pin Sharprompt.SourceGenerator to Roslyn 4.11 for .NET 8/9 SDK compatibility#349
shibayan merged 2 commits intomasterfrom
copilot/fix-compatibility-for-dotnet-8-9

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

Sharprompt 3.1.0 packs Sharprompt.SourceGenerator.dll as an analyzer, and that analyzer was built against Roslyn 5.3.0. Under .NET 8/9 SDKs, that can trigger CS9057 even in consumers that do not use source generation.

  • What changed

    • Downgraded the Microsoft.CodeAnalysis.CSharp package used by Sharprompt.SourceGenerator from 5.3.0 to 4.11.0.
    • Kept the package layout unchanged: Sharprompt still packs the source generator analyzer, but it now targets a compiler version compatible with supported SDKs.
  • Why this addresses the issue

    • The failure was caused by the packaged analyzer referencing a newer compiler than the SDK-provided compiler.
    • Aligning the generator with Roslyn 4.11 removes that version mismatch for .NET 8/9 consumers.
  • Dependency change

    <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />

Copilot AI linked an issue Apr 14, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/shibayan/Sharprompt/sessions/a7e60249-05c6-402e-9f71-ed4e19f14808

Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compatibility of Sharprompt 3.1.0 with .NET 8 and 9 SDK Pin Sharprompt.SourceGenerator to Roslyn 4.11 for .NET 8/9 SDK compatibility Apr 14, 2026
Copilot AI requested a review from shibayan April 14, 2026 09:11
@shibayan shibayan marked this pull request as ready for review April 14, 2026 09:34
@shibayan shibayan merged commit 6cb5807 into master Apr 14, 2026
5 checks passed
@shibayan shibayan deleted the copilot/fix-compatibility-for-dotnet-8-9 branch April 14, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.1.0 not compatible with .NET 8/9 SDK

2 participants