Skip to content

Move to Roslyn's unified ExternalAccess library - #68014

Merged
wtgodbe merged 10 commits into
mainfrom
dev/jorobich/unified-externalaccess
Aug 31, 2026
Merged

wtgodbe merged 10 commits into
mainfrom
dev/jorobich/unified-externalaccess

Conversation

@JoeRobich

@JoeRobich JoeRobich commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Move to Roslyn's unified ExternalAccess library

Change references to Microsoft.CodeAnalysis.ExternalAccess.AspNetCore into references to Microsoft.CodeAnalysis.Features.ExternalAccess.

Description

It is necessary to consume a newer version of Roslyn to bring in the new unified EA library. This version has already inserted into the .NET 11 SDK, the C# extension for VS Code, and VS main.

Building analyzers against a newer version of Roslyn requires a newer version of the Roslyn compiler to host the analyzers during the build. This required changes to the global.json configuration to pin the .NET SDK to preview 7.

Fixes #68013

Copilot AI review requested due to automatic review settings July 24, 2026 20:47
@JoeRobich
JoeRobich requested review from a team and wtgodbe as code owners July 24, 2026 20:47

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

Updates ASP.NET Core analyzers infrastructure to consume Roslyn’s unified ExternalAccess library by switching assembly/package references and aligning the repo’s Roslyn dependency versions accordingly. This helps reduce ExternalAccess assembly loads in VS scenarios and enables building against newer Roslyn bits.

Changes:

  • Switch analyzer assembly reference from Microsoft.CodeAnalysis.ExternalAccess.AspNetCore to Microsoft.CodeAnalysis.Features.ExternalAccess.
  • Update Roslyn package versions to 5.10.0-1.26357.6 and adjust dependency metadata accordingly.
  • Opt into Arcade’s Microsoft.Net.Compilers flow and pin the compiler toolset version to match the Roslyn update.
Show a summary per file
File Description
src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteEmbeddedLanguage/README.md Updates documentation to reference the unified ExternalAccess assembly name.
src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj Switches the ExternalAccess assembly reference to Microsoft.CodeAnalysis.Features.ExternalAccess.
eng/Versions.props Bumps Roslyn version, opts into Microsoft.Net.Compilers usage, and pins compiler toolset version.
eng/Version.Details.xml Updates Roslyn dependency entries (names/versions/shas) to match the new Roslyn build.
eng/Version.Details.props Renames/updates version properties for the unified ExternalAccess package and Roslyn version bump.
eng/Dependencies.props Updates dependency list and source-only overrides to use the unified ExternalAccess package name.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 0

@wtgodbe wtgodbe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

wtgodbe pushed a commit to wtgodbe/aspnetcore that referenced this pull request Jul 29, 2026
…tern, cover all DependabotDiscovery exclusion categories

Copilot's automated review on dotnet#68097 caught two real bugs:
- The Include="..." regex only matched self-closing tags with no other
  attributes, silently missing entries like
  <LatestPackageReference Include="xunit.v3" Version="$(XunitV3Version)" />.
  Fixed with a regex that tolerates any attributes/tag layout, and now joins
  file content into one string so a tag split across lines is still matched.
- 'return , $x' combined with inconsistent @(...) wrapping at call sites
  caused double array-wrapping in some paths, silently shrinking the
  Maestro-managed-properties set from ~440 entries to 1-2. Removed the
  comma-trick entirely; every call site now consistently wraps in @(...).

Additionally, two independent review agents pointed out that
eng/tools/DependabotDiscovery/README.md documents more exclusion categories
than just Maestro: packages pinned via the shared $(IdentityModelVersion)
property, packages mapped to an in-repo project via ProjectReferenceProvider
(eng/ProjectReferences.props), and two hard-coded packages
(NETStandard.Library, Microsoft.CodeAnalysis.PublicApiAnalyzers). The check
now recognizes all of these, matching the original error message's intent
('isn't managed by Maestro or the shared $(IdentityModelVersion) property').

Verified end-to-end in isolated worktrees against the real repo history:
- PR dotnet#68014's actual rename (Maestro-managed) - passes
- A synthetic new, non-excluded package addition - still fails as expected
- A full IdentityModel-managed rename (Dependencies.props + Versions.props) - passes
- A ProjectReferenceProvider-mapped name - passes
- The hard-coded NETStandard.Library exclusion - passes

Co-authored-by: Copilot <[email protected]>
@JoeRobich
JoeRobich requested a review from a team as a code owner July 29, 2026 21:58
wtgodbe added a commit that referenced this pull request Jul 30, 2026
…nges (#68097)

* Only require DependabotDiscovery.csproj update for non-Maestro dependency changes

The CodeCheck added in #68012 flagged any add/remove in eng/Dependencies.props
as requiring a matching update to eng/tools/DependabotDiscovery/DependabotDiscovery.csproj.
This incorrectly fires when a Maestro-managed package is renamed (as in #68014),
since that shows up as one add + one remove even though DependabotDiscovery.csproj
never referenced it (Maestro-managed packages are excluded, see the project's README).

Now the check compares the set of <LatestPackageReference Include="..." /> names
before/after and only requires a DependabotDiscovery.csproj update when an added or
removed package has no matching version property in eng/Version.Details.props
(i.e. isn't managed by Maestro).

Co-authored-by: Copilot <[email protected]>

* Address PR review feedback: fix regex, avoid fragile array-return pattern, cover all DependabotDiscovery exclusion categories

Copilot's automated review on #68097 caught two real bugs:
- The Include="..." regex only matched self-closing tags with no other
  attributes, silently missing entries like
  <LatestPackageReference Include="xunit.v3" Version="$(XunitV3Version)" />.
  Fixed with a regex that tolerates any attributes/tag layout, and now joins
  file content into one string so a tag split across lines is still matched.
- 'return , $x' combined with inconsistent @(...) wrapping at call sites
  caused double array-wrapping in some paths, silently shrinking the
  Maestro-managed-properties set from ~440 entries to 1-2. Removed the
  comma-trick entirely; every call site now consistently wraps in @(...).

Additionally, two independent review agents pointed out that
eng/tools/DependabotDiscovery/README.md documents more exclusion categories
than just Maestro: packages pinned via the shared $(IdentityModelVersion)
property, packages mapped to an in-repo project via ProjectReferenceProvider
(eng/ProjectReferences.props), and two hard-coded packages
(NETStandard.Library, Microsoft.CodeAnalysis.PublicApiAnalyzers). The check
now recognizes all of these, matching the original error message's intent
('isn't managed by Maestro or the shared $(IdentityModelVersion) property').

Verified end-to-end in isolated worktrees against the real repo history:
- PR #68014's actual rename (Maestro-managed) - passes
- A synthetic new, non-excluded package addition - still fails as expected
- A full IdentityModel-managed rename (Dependencies.props + Versions.props) - passes
- A ProjectReferenceProvider-mapped name - passes
- The hard-coded NETStandard.Library exclusion - passes

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Will Godbe <[email protected]>
Co-authored-by: Copilot <[email protected]>
@JoeRobich

Copy link
Copy Markdown
Member Author

Well, I thought we could get this in by simply having Arcade use the newer compilers, but some tests are trying to build with bits and getting them to use the compiler package may not be worth it. I will wait until this repo is using a preview 7 SDK and we can revert the unnecessary changes to the version.props.

Copilot stopped work on behalf of JoeRobich due to an error August 20, 2026 06:28
@JoeRobich

Copy link
Copy Markdown
Member Author

@wtgodbe This is ready to go in. Thanks for your help!

@wtgodbe
wtgodbe merged commit 8883c3a into main Aug 31, 2026
32 checks passed
@wtgodbe
wtgodbe deleted the dev/jorobich/unified-externalaccess branch August 31, 2026 16:02
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 2, 2026
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.

Use Roslyn's unified ExternalAccess library

3 participants