Skip to content

Conversation

Copy link

Copilot AI commented Feb 7, 2026

Summary

Fix RS1038 CI failures (169 errors) caused by Microsoft.CodeAnalysis.Workspaces leaking into analyzer assemblies.

Root Cause

Two vectors:

  1. ANcpLua.Roslyn.Utilities 1.30.2 transitively depends on Workspaces.Common (via CodeFixProviderBase - the only class that needed it)
  2. CSharp.Workspaces centrally defined + CentralPackageTransitivePinningEnabled=true amplified the leak into all projects

Fix (this PR)

  • Remove CSharp.Workspaces from central PackageVersion (eliminates vector 2)
  • Add ExcludeAssets=all for Workspaces.Common in analyzer projects (blocks vector 1)
  • Switch CodeFixes/Tests to VersionOverride since Workspaces is no longer centrally managed

Upstream Fix

ANcpLua/ANcpLua.Roslyn.Utilities#29 moves CodeFixProviderBase from the core package to Testing, removing the Workspaces dependency entirely. Once published as 1.31.0, these workarounds can be reverted.

Test plan

  • dotnet build -c Release: 0 errors, 0 warnings
  • dotnet test: 726 passed, 0 failed
  • Upstream PR created and pushed

@ANcpLua
Copy link
Owner

ANcpLua commented Feb 7, 2026

@claude implement

@ANcpLua
Copy link
Owner

ANcpLua commented Feb 7, 2026

Still failing — the Workspaces leak is from ANcpLua.Roslyn.Utilities 1.30.2 itself depending on Microsoft.CodeAnalysis.Workspaces.Common. It's not from CPM pinning.
@claude
@copilot

@ANcpLua ANcpLua requested a review from Copilot February 7, 2026 20:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

Copilot AI changed the title [WIP] Fix CI failure due to RS1038 errors Fix RS1038 errors in analyzer projects (169 CI failures) Feb 7, 2026
Copilot AI requested a review from ANcpLua February 7, 2026 20:07
Copy link
Author

Copilot AI commented Feb 7, 2026

Still failing — the Workspaces leak is from ANcpLua.Roslyn.Utilities 1.30.2 itself depending on Microsoft.CodeAnalysis.Workspaces.Common. It's not from CPM pinning.
@claude
@copilot

You're absolutely right! The issue was ANcpLua.Roslyn.Utilities 1.30.2 depending on Workspaces.Common, not CPM pinning.

Fixed in commit c52c28e by downgrading to version 1.28.0 for analyzer projects. Version 1.28.0 doesn't have the Workspaces.Common dependency (it was added in 1.29.0+).

The Workspaces packages are now completely removed from the analyzer dependency tree and RS1038 errors should be resolved.

Copilot AI changed the title Fix RS1038 errors in analyzer projects (169 CI failures) Fix RS1038 errors by downgrading Roslyn.Utilities to 1.28.0 in analyzers Feb 7, 2026
@ANcpLua ANcpLua marked this pull request as ready for review February 7, 2026 20:14
Two vectors caused Workspaces to leak into analyzer projects:

1. ANcpLua.Roslyn.Utilities transitively depends on Workspaces.Common
2. CSharp.Workspaces centrally defined + transitive pinning amplified it

Fix:
- Remove CSharp.Workspaces from central PackageVersion
- Add ExcludeAssets="all" for Workspaces.Common in analyzer projects
- Switch CodeFixes/Tests to VersionOverride for CSharp.Workspaces

Upstream fix: ANcpLua/ANcpLua.Roslyn.Utilities#29 removes Workspaces
from the core package entirely. Once published, these workarounds can
be reverted and CSharp.Workspaces restored to central management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ANcpLua ANcpLua force-pushed the copilot/fix-ci-errors-rs1038 branch from c52c28e to 1e33ef8 Compare February 7, 2026 20:16
@ANcpLua
Copy link
Owner

ANcpLua commented Feb 7, 2026

Closing in favor of the upstream fix: ANcpLua/ANcpLua.Roslyn.Utilities#29 removes Workspaces.Common from the core package entirely. Once 1.31.0 publishes, Analyzers just needs to update to the new version — no VersionOverride pins needed.

@ANcpLua ANcpLua closed this Feb 7, 2026
@ANcpLua ANcpLua deleted the copilot/fix-ci-errors-rs1038 branch February 7, 2026 20:19
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.

2 participants