Skip to content

[main] Bump Microsoft.CodeAnalysis.Analyzers and Microsoft.CodeAnalysis.Common - #10622

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/multi-c6ec275757
Closed

[main] Bump Microsoft.CodeAnalysis.Analyzers and Microsoft.CodeAnalysis.Common#10622
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/multi-c6ec275757

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 18, 2026

Copy link
Copy Markdown
Contributor

Updated Microsoft.CodeAnalysis.Analyzers from 5.6.0 to 5.9.0-1.26328.17.

Release notes

Sourced from Microsoft.CodeAnalysis.Analyzers's releases.

No release notes found for this version range.

Commits viewable in compare view.

Updated Microsoft.CodeAnalysis.Common from 3.11.0 to 5.9.0.

Release notes

Sourced from Microsoft.CodeAnalysis.Common's releases.

5.0.4

Release

5.0.2

Release Notes
Install Instructions

Repos

5.0.1

Release Notes
Install Instructions

Repo

4.2.0-4.22266.5

Release

4.2.0-3.22151.16

Release

4.2.0-1.22108.11

Release

4.0.0-2.21354.7

Release

4.0.0-2.21254.26

Release

4.0.0-1.21277.15

Release

Commits viewable in compare view.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

…is.Common

Bumps Microsoft.CodeAnalysis.Analyzers from 5.6.0 to 5.9.0-1.26328.17
Bumps Microsoft.CodeAnalysis.Common from 3.11.0 to 5.9.0

---
updated-dependencies:
- dependency-name: Microsoft.CodeAnalysis.Analyzers
  dependency-version: 5.9.0-1.26328.17
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: Microsoft.CodeAnalysis.Common
  dependency-version: 5.9.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added .NET Pull requests that update .NET code dependencies Updates to dependency manifests. labels Aug 18, 2026
Copilot AI balanced review requested due to automatic review settings August 18, 2026 06:54
@dependabot dependabot Bot added the .NET Pull requests that update .NET code label Aug 18, 2026

Copilot AI left a comment

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.

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates Roslyn-related package versions in central package management to newer releases.

Changes:

  • Bumps MicrosoftCodeAnalysisVersion from 3.11.0 to 5.9.0
  • Updates Microsoft.CodeAnalysis.Analyzers package version to a 5.9.0-* build

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Directory.Packages.props
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.6.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.9.0-1.26328.17" />
Comment thread Directory.Packages.props
Comment on lines 32 to 33
<MicrosoftCodeAnalysisVersionForTests>4.10.0</MicrosoftCodeAnalysisVersionForTests>
<MicrosoftCodeAnalysisVersionForSourceGen>4.8.0</MicrosoftCodeAnalysisVersionForSourceGen>
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Build Failure Analysis

Summary — Bumping Microsoft.CodeAnalysis 3.11.0→5.9.0 and Microsoft.CodeAnalysis.Analyzers 5.6.0→5.9.0-1.26328.17 breaks the build in two independent ways: the new Roslyn IDE analyzers now flag existing MSTest.Analyzers source with IDE0303 errors (Linux/macOS legs), and the newer Microsoft.CodeAnalysis.CSharp API changed overload resolution for a generic method used in MSTest.Analyzers.CodeFixes, breaking compilation (Windows legs).

Root cause 1: IDE0303 promoted to error across MSTest.Analyzers (Linux + macOS legs)

The upgraded Microsoft.CodeAnalysis toolchain ships/enables a newer built-in IDE analyzer set. IDE0303 ("Collection initialization can be simplified") now fires on ~25 analyzer source files that use ImmutableArray.Create(Rule) instead of collection-expression syntax ([Rule]), and the repo's ruleset treats these as build errors. This is a repo-wide style violation surfaced only by the new analyzer version, not a logic bug.

Affected files / errors (25 files × 2 diagnostics each; representative sample)

Proposed fix — replace ImmutableArray.Create(Rule) initializers with the collection-expression form:

-    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create(Rule);
+    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = [Rule];

Given the number of affected files (~25), this is best applied as a mechanical find-and-replace across src/Analyzers/MSTest.Analyzers/*.cs (or via dotnet format since IDE0303 is fixer-eligible) rather than via individual suggestions.

Root cause 2: CS1503 in FixtureMethodFixer.csSeparatedList<SyntaxNode> no longer implicitly convertible (Windows legs)

Microsoft.CodeAnalysis.CSharp's SyntaxFactory.SeparatedList<TNode> overload resolution changed between 3.11.0 and 5.9.0: SyntaxFactory.SeparatedList(GetParameters(...)), where GetParameters returns IEnumerable<SyntaxNode>, now resolves to SeparatedList<SyntaxNode> instead of inferring SeparatedList<ParameterSyntax>, so the result can no longer be passed to SyntaxFactory.ParameterList(SeparatedList<ParameterSyntax>).

Affected files / errors

Proposed fix — make the type parameter explicit so overload resolution isn't ambiguous:

         fixedMethodDeclarationNode = ((MethodDeclarationSyntax)fixedMethodDeclarationNode)
             .WithParameterList(
                 SyntaxFactory.ParameterList(
-                    SyntaxFactory.SeparatedList(
+                    SyntaxFactory.SeparatedList<ParameterSyntax>(
                         GetParameters(syntaxGenerator, isParameterLess, wellKnownTypeProvider))))

Build overview
  • Linux Debug — FAILED, 189 errors (mostly IDE0303), MSBuild 18.11.0-1.26402.102
  • Windows Debug — FAILED, 2 errors (CS1503 in MSTest.Analyzers.CodeFixes.csproj + cascading "Build failed."), MSBuild 18.7.1
  • Windows/macOS Release legs show the same CS1503 failure; Linux Release and macOS Debug/Release show the same IDE0303 pattern.
  • Root cause 1 (IDE0303) and root cause 2 (CS1503) are independent — both must be fixed for all 7 legs to pass.
Sample MSBuild errors
Code Project File:Line Message
IDE0303 MSTest.Analyzers AssemblyCleanupShouldBeValidAnalyzer.cs:29 Collection initialization can be simplified
IDE0303 MSTest.Analyzers AssemblyFixtureProviderNotSupportedWithNativeAotAnalyzer.cs:37 Collection initialization can be simplified
CS1503 MSTest.Analyzers.CodeFixes FixtureMethodFixer.cs:39 Argument 1: cannot convert SeparatedSyntaxList<SyntaxNode> to SeparatedSyntaxList<ParameterSyntax>

🤖 Generated by the Build Failure Analysis workflow using binlog-mcp · commit a8bbffe

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 118.4 AIC · ⌖ 2.08 AIC · ⊞ 11.6K · [◷]( · )

@github-actions github-actions Bot left a comment

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.

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 118.4 AIC · ⌖ 2.08 AIC · ⊞ 11.6K ·

Comment thread Directory.Packages.props
<AspireHostingTestingVersion>13.4.6</AspireHostingTestingVersion>
<MicrosoftBuildVersion>17.11.48</MicrosoftBuildVersion>
<MicrosoftCodeAnalysisVersion>3.11.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersion>5.9.0</MicrosoftCodeAnalysisVersion>

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.

🔧 CS1503/IDE0303 — Bumping Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Common to 5.9.0 breaks the build: newer built-in IDE0303 diagnostics fire as errors across ~25 files in src/Analyzers/MSTest.Analyzers/*.cs (e.g. ImmutableArray.Create(Rule)[Rule]), and SyntaxFactory.SeparatedList overload resolution changes cause a CS1503 in src/Analyzers/MSTest.Analyzers.CodeFixes/Helpers/FixtureMethodFixer.cs:39. See the summary comment for proposed fixes to both.

@Evangelink

Copy link
Copy Markdown
Member

Closing because this update is not safe for the shipping MSTest analyzers.

Aligning Microsoft.CodeAnalysis.Analyzers resolves the package downgrade from the related update, but the current CI run still fails across all build legs. The failures include a Roslyn API CS1503 in FixtureMethodFixer.cs and new IDE0303 diagnostics treated as errors.

More importantly, the changed property is used to compile the analyzer and code-fix DLLs shipped in MSTest.Analyzers and consumed through MSTest.TestFramework. Roslyn 5.x has a minimum supported host of Visual Studio 2026 18.0, so this would drop Visual Studio 2019 and 2022 analyzer compatibility. PrivateAssets does not prevent that host compatibility break because the compiled analyzer DLLs are shipped.

The shipping analyzer baseline should remain on Roslyn 3.11 unless dropping those Visual Studio versions is an explicit product decision. A newer Roslyn version needed only for development should use a separate version override.

@dependabot @github

dependabot Bot commented on behalf of github Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

OK, I won't notify you again about this release, but will get in touch when a new version is available. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot
dependabot Bot deleted the dependabot/nuget/multi-c6ec275757 branch August 26, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Updates to dependency manifests. .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants