Skip to content

Make the analyzer probe actually run under Roslyn 4.8 - #46

Merged
brandonifco merged 2 commits into
mainfrom
fix/analyzer-probe-on-the-roslyn-floor
Sep 15, 2026
Merged

brandonifco merged 2 commits into
mainfrom
fix/analyzer-probe-on-the-roslyn-floor

Conversation

@brandonifco

Copy link
Copy Markdown
Owner

Found while investigating item 6 (analyzer scope).

Defect. tools/analyzer-probe/check.sh says its net8.0 consumer protects the analyzer's Roslyn 4.8 floor (ADR 0011). It never ran Roslyn 4.8. The consumers had no global.json, and dotnet build <path> resolves the SDK from the working directory, which was the repository root on SDK 10. I checked: with Microsoft.CodeAnalysis.CSharp raised to 5.0.0, the probe still reported ok.

Fix.

  • Each consumer gets a global.json pinning the newest installed 8.0 SDK, which CI already installs.
  • Both consumer builds run from the consumer's own directory, with UseSharedCompilation=false.
  • The probe asserts which SDK was selected, and it fails if no 8.0 SDK is installed.

Verified. With the analyzer built against Roslyn 5.0, the probe now fails with CS9057 ... references version '5.0.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'. On the real 4.8 pin, it passes.

This is the failure #42 (Dependabot's 4.8 → 5.9 bump) would have shipped into the gate.

🤖 Generated with Claude Code

brandonifco and others added 2 commits September 15, 2026 13:31
The probe claimed to protect the analyzer's Roslyn 4.8 floor, but its
consumers were built with whatever SDK the working directory resolved: the
repository's SDK 10. Rebuilding the analyzer against Microsoft.CodeAnalysis
5.0 still passed the probe.

Consumers now carry a global.json pinning the newest installed 8.0 SDK, build
from their own directory with the shared compiler off, and the probe fails if
no 8.0 SDK exists. With the analyzer built against Roslyn 5.0 it now fails with
CS9057.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@brandonifco
brandonifco merged commit 3cec4e1 into main Sep 15, 2026
2 checks passed
@brandonifco
brandonifco deleted the fix/analyzer-probe-on-the-roslyn-floor branch September 15, 2026 17:35
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.

1 participant