Skip to content

[release/11.0.1xx] Use SDK directory for CLI forwarding and command search - #55988

Open
baronfel wants to merge 5 commits into
release/11.0.1xxfrom
backport/11.0.1xx/pr-55920
Open

[release/11.0.1xx] Use SDK directory for CLI forwarding and command search#55988
baronfel wants to merge 5 commits into
release/11.0.1xxfrom
backport/11.0.1xx/pr-55920

Conversation

@baronfel

@baronfel baronfel commented Aug 28, 2026

Copy link
Copy Markdown
Member

Backport of #55920, #55923, and #55925 to release/11.0.1xx.

  • resolve dotnet format assets from the versioned SDK directory
  • resolve NuGet, VSTest, and FSI forwarding assets from the versioned SDK directory
  • search the versioned SDK directory first for environment commands
  • include managed and NativeAOT regression coverage

Copilot AI and others added 5 commits August 28, 2026 08:51
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Resolve NuGet, VSTest, and FSI assets from SdkPaths so NativeAOT help forwarding uses the selected SDK instead of the muxer directory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6929a73-7e24-4f78-830c-f6ae2a14b812
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c6929a73-7e24-4f78-830c-f6ae2a14b812
Copilot AI lite review requested due to automatic review settings August 28, 2026 13:57
@baronfel
baronfel requested a review from a team as a code owner August 28, 2026 13:57
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Fixes dotnet format forwarding path resolution so the NativeAOT CLI uses the versioned SDK directory (via SdkPaths.SdkDirectory) instead of AppContext.BaseDirectory, matching where DotnetTools/dotnet-format is laid out in the SDK.

Changes:

  • Update FormatForwardingApp to resolve dotnet-format.dll, .deps.json, and .runtimeconfig.json from SdkPaths.SdkDirectory.
  • Add an AOT-focused regression test that sets Microsoft.DotNet.Sdk.Root and verifies forwarded dotnet format paths use that versioned SDK directory.
  • Extract the test helper SdkDirectoryScope into its own file for reuse across AOT tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/dotnet-aot.Tests/SdkDirectoryScope.cs Adds a reusable scope helper to set/restore Microsoft.DotNet.Sdk.Root and clear the SdkPaths cache for tests.
test/dotnet-aot.Tests/MSBuildEvaluationTests.cs Removes the inline SdkDirectoryScope now that it’s shared.
test/dotnet-aot.Tests/FormatForwardingAppTests.cs Adds regression coverage ensuring dotnet format forwarding uses the versioned SDK directory.
src/Cli/dotnet/Commands/Format/FormatForwardingApp.cs Switches dotnet format forwarder asset paths from AppContext.BaseDirectory to SdkPaths.SdkDirectory.

@baronfel
baronfel requested review from a team as code owners August 28, 2026 14:10
@baronfel baronfel changed the title [release/11.0.1xx] Fix dotnet format forwarding under NativeAOT [release/11.0.1xx] Use SDK directory for CLI forwarding and command search Aug 28, 2026
@baronfel

Copy link
Copy Markdown
Member Author

@dsplaisted here are those three PRs backported to 11 so that AOT forwarded apps work

@baronfel baronfel added backport PR that has been backported to a servicing branch and removed Servicing-consider labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport PR that has been backported to a servicing branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants