Skip to content

Pack analyzer per roslyn version#206

Merged
koenbeuk merged 2 commits intomasterfrom
fix/issue-205
Apr 30, 2026
Merged

Pack analyzer per roslyn version#206
koenbeuk merged 2 commits intomasterfrom
fix/issue-205

Conversation

@koenbeuk
Copy link
Copy Markdown
Collaborator

@koenbeuk koenbeuk commented Apr 30, 2026

fixes #205

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the NuGet packing process so the source generator + code fixes are built and packaged as separate analyzer assemblies per Roslyn version, allowing NuGet/MSBuild to pick a host-compatible analyzer at install/build time.

Changes:

  • Build analyzer variants for Roslyn 4.8.0 and 5.0.0 during pack and place them under analyzers/dotnet/roslyn{X.Y}/cs/.
  • Update the generator’s ROSLYN_5_0_OR_LATER conditional compilation symbol to be driven by $(RoslynAnalyzerVersion) instead of the host SDK version.
  • Exclude canonical bin/ and obj/ from default compile globs in analyzer projects to avoid AssemblyInfo duplication during variant builds.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/EntityFrameworkCore.Projectables.Generator/EntityFrameworkCore.Projectables.Generator.csproj Adjusts ROSLYN_5_0_OR_LATER definition to follow RoslynAnalyzerVersion and excludes bin/obj from default compile items.
src/EntityFrameworkCore.Projectables.CodeFixes/EntityFrameworkCore.Projectables.CodeFixes.csproj Excludes bin/obj from default compile items to prevent duplicate compilation inputs during variant builds.
src/EntityFrameworkCore.Projectables.Abstractions/EntityFrameworkCore.Projectables.Abstractions.csproj Adds pack-time targets to build Roslyn-specific analyzer variants and packs those DLLs into Roslyn-versioned analyzer folders.

@PhenX
Copy link
Copy Markdown
Member

PhenX commented Apr 30, 2026

Thanks, I was looking for a way to fix it this way, but could not take a decision on the best way

@koenbeuk koenbeuk merged commit a150e7f into master Apr 30, 2026
4 checks passed
@koenbeuk koenbeuk deleted the fix/issue-205 branch April 30, 2026 18:22
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.

Analyzer incompatibility with .NET SDK 8.0 (compiler version mismatch)

3 participants