Repository navigation
Keep source-built ASP.NET Core analyzers bootstrap-compatible - #10335
Merged
Merged
Conversation
Use previous Roslyn packages for source-only analyzer dependencies so they remain compatible with the bootstrap compiler and runtime. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 870e3b3c-1829-44c7-81fd-f26e992b792f
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
lbussell
approved these changes
Oct 20, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow override follows the existing bootstrap-version pattern, with no blocking issues identified in static review.
No open issues 🎉
What changed in this PR
Keeps source-built ASP.NET Core analyzers compatible with the bootstrap compiler and runtime.
Changes:
- Uses the previous Roslyn package version for the source-only analyzer override.
- Updates the comment to explain bootstrap compatibility.
| File | Description |
|---|---|
repo-projects/aspnetcore.proj |
Aligns analyzer dependencies with the existing bootstrap-compatible generator approach. |
Review effort: Balanced
akoeplinger
reviewed
Oct 20, 2026
wtgodbe
approved these changes
Oct 20, 2026
mthalman
enabled auto-merge (squash)
October 20, 2026 15:57
This was referenced Oct 21, 2026
This was referenced Oct 29, 2026
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Error or behavior: Source-build fails with CS8032 while compiling
Microsoft.DotNet.HotReload.Watch. ASP.NET Core analyzers and the validation generator cannot loadSystem.Collections.Immutable, Version=12.0.0.0.Root cause (high confidence): The source-only override for
MicrosoftCodeAnalysisVersion_LatestVSselects current source-built Roslyn packages. Following the .NET 12 retargeting in #10156, these introduce dependencies on runtime assemblies unavailable to the bootstrap compiler, which runs on .NET 11.Why PR source-build checks passed
The source-build jobs for #10156 ran and passed in public build 1641241, including the Microsoft-SDK and current-source-built-SDK legs.
Assembly metadata comparisons confirm that both the PR and failing official packages reference
System.Collections.Immutable 12.0.0.0. However, their Roslyn references differ:Microsoft.CodeAnalysisidentity42.42.42.42. Roslyn rejects these as targeting a newer compiler before instantiating analyzer types, reporting CS9057. Watch's existing source-only CS9057 suppression masks this skip.Microsoft.CodeAnalysis 5.13.0.0, matching the bootstrap compiler. They pass the compiler-version check, then fail during initialization with CS8032 because the bootstrap runtime cannot load Immutable 12.0.0.0.Both SDK binlogs identify the same bootstrap SDK and compiler. The incompatible dependency therefore exists in both builds but is masked in PR builds, not because source-build jobs were omitted or CS8032 was suppressed.
Description
Fix: Change the source-only override to use
MicrosoftCodeAnalysisCommonPreviousVersion, keeping analyzer dependencies compatible with the bootstrap compiler and its runtime. This follows the existing previous-package approach used for ASP.NET Core source generators. Update the adjacent rationale accordingly.Fixes dotnet/source-build#5674