Skip to content

Fix duplicate analyzers - #550

Open
soda0289 wants to merge 1 commit into
bazel-contrib:masterfrom
soda0289:fix-duplicate-analyzers
Open

Fix duplicate analyzers#550
soda0289 wants to merge 1 commit into
bazel-contrib:masterfrom
soda0289:fix-duplicate-analyzers

Conversation

@soda0289

Copy link
Copy Markdown
Contributor

Fixes #467 by removing duplicate analyzers by matching by name. An analyzer can get added twice when a nuget package and framework sdk both include the same analyzer. This happened with Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll since both Microsoft.Extensions.Configuration.Binder and dotnet ASP.Net web framework include it.

MSBuild resolves duplicate analyzers in ResolvePackageFileConflicts  by using file name ( ci => ci.FileName ), then breaks ties by AssemblyVersion (managed metadata) and FileVersion (Win32 resource).

This is the same kind of fix as PR #512 but includes reproduction test case and an e2e regression test.

@soda0289
soda0289 requested a review from purkhusid as a code owner July 14, 2026 22:02
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.

Source generator issue in Microsoft.Configuration.Binder package

1 participant