Skip to content

Update CodeAnalysis and MSBuild packages - #18

Merged
yaakov-h merged 9 commits into
masterfrom
yaakov/upgrade-roslyn
Jul 7, 2026
Merged

Update CodeAnalysis and MSBuild packages#18
yaakov-h merged 9 commits into
masterfrom
yaakov/upgrade-roslyn

Conversation

@yaakov-h

@yaakov-h yaakov-h commented Jul 1, 2026

Copy link
Copy Markdown
Member

This PR:

  • Defines the .NET SDK version to use, since my dev laptop defaulted to .NET 11 Preview 😆
  • Upgrades Roslyn to latest (5.3.0, equivalent to .NET SDK 10.0.200)
  • Unlocks C# 12 syntax (up from C# 11).
  • Changes the way that Analyzer assemblies get loaded, since things broke on upgrade. We now use Roslyn's APIs to do this instead of hitting the .NET runtime ourselves, where possible.

yaakov-h added 5 commits July 1, 2026 11:06
Bump Microsoft.CodeAnalysis and Microsoft.CodeAnalysis.Workspaces.MSBuild
from 4.4.0 to 5.3.0 (latest), and Microsoft.Build.Locator from 1.5.5 to
1.11.2 to match. Pin Microsoft.Build.Framework to the version Workspaces.MSBuild
5.x expects, excluded from runtime assets so MSBuildLocator's copy wins.
@yaakov-h
yaakov-h marked this pull request as ready for review July 2, 2026 04:34
@yaakov-h
yaakov-h requested a review from brian-reichle as a code owner July 2, 2026 04:34

public abstract ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(Project project);
public abstract ImmutableDictionary<string, ImmutableList<CodeFixProvider>> GetAllCodeFixProviders(Project project);
public ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(Project project)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This implementation seems like it would be specific to the Implicit strategy.

Comment thread src/WTG.BulkAnalysis.Core/Internal/AnalyzerCache.cs Outdated
return builder.ToImmutable();
}

public ImmutableDictionary<string, ImmutableList<CodeFixProvider>> GetAllCodeFixProviders(Project project)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this also seems like it would be specific to the Implicit strategy.

Comment thread src/WTG.BulkAnalysis.Core/Internal/AnalyzerCache.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 modernizes the BulkAnalysisRunner toolchain by pinning the .NET SDK, upgrading Roslyn/MSBuild-related dependencies, enabling C# 12, and refactoring analyzer/code-fix loading to rely more on Roslyn’s analyzer-loading APIs (with added test coverage for the new loading behavior).

Changes:

  • Pin the repository to a specific .NET SDK via global.json and enable C# 12 / .NET analyzers in Directory.Build.props.
  • Upgrade Roslyn packages and adjust runtime binding redirects to match the newer Roslyn dependency set.
  • Rework analyzer/code-fix loading in AnalyzerCache (and add tests) to avoid manual runtime assembly resolution.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/WTG.BulkAnalysis.Test/AnalyzerCacheTest.cs Adds tests validating analyzer discovery from an explicitly provided assembly.
src/WTG.BulkAnalysis.Test/.editorconfig Suppresses several Roslyn analyzer rules specifically for the test project.
src/WTG.BulkAnalysis.Runner/WTG.BulkAnalysis.Runner.csproj Updates MSBuild/Roslyn-adjacent package references (e.g., MSBuild Locator, StyleCop).
src/WTG.BulkAnalysis.Runner/Program.cs Removes AppDomain.AssemblyResolve hook previously used for analyzer dependency resolution.
src/WTG.BulkAnalysis.Runner/App.config Updates binding redirects to align with the upgraded Roslyn and dependency versions.
src/WTG.BulkAnalysis.Core/WTG.BulkAnalysis.Core.csproj Upgrades Roslyn packages and StyleCop analyzer package versions.
src/WTG.BulkAnalysis.Core/Processor.cs Updates AnalyzerCache.Create(...) call to pass through context.Log.
src/WTG.BulkAnalysis.Core/Internal/AnalyzerCache.cs Refactors analyzer/code-fix discovery to use AnalyzerFileReference APIs; introduces logging and caching for references/providers.
global.json Pins the repo to a specific .NET SDK version.
Directory.Build.props Enables C# 12 and turns on SDK-provided .NET analyzers.
.github/workflows/build.yaml Adds actions/setup-dotnet@v5 to CI (but needs adjustments to reliably honor global.json).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/WTG.BulkAnalysis.Core/Internal/AnalyzerCache.cs
Comment thread .github/workflows/build.yaml
Comment thread src/WTG.BulkAnalysis.Core/Internal/AnalyzerCache.cs Outdated
@yaakov-h
yaakov-h enabled auto-merge (squash) July 3, 2026 00:45
@yaakov-h
yaakov-h requested a review from brian-reichle July 6, 2026 01:08
@yaakov-h
yaakov-h merged commit 7835580 into master Jul 7, 2026
2 checks passed
@yaakov-h
yaakov-h deleted the yaakov/upgrade-roslyn branch July 7, 2026 05:18
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 participants