Skip to content

Stop forcing MSBuild server for Aspire CLI builds#17313

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-timeout-error-sdk-10-0-300
Open

Stop forcing MSBuild server for Aspire CLI builds#17313
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-timeout-error-sdk-10-0-300

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Description

aspire run can fail on Linux with .NET SDK 10.0.300 when the CLI forces MSBuild server usage, surfacing as a named-pipe timeout during the AppHost build.

  • CLI behavior

    • Stop setting DOTNET_CLI_USE_MSBUILD_SERVER for dotnet run / dotnet build invocations.
    • Let the .NET SDK decide the MSBuild server behavior.
  • Tests

    • Update DotNetCliRunner coverage to assert the CLI no longer injects DOTNET_CLI_USE_MSBUILD_SERVER.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
@davidfowl davidfowl marked this pull request as ready for review May 20, 2026 14:53
Copilot AI review requested due to automatic review settings May 20, 2026 14:53
@davidfowl davidfowl self-requested a review as a code owner May 20, 2026 14:53
Copilot AI changed the title [WIP] Fix timeout exception for Aspire project on SDK 10.0.300 Stop forcing MSBuild server for Aspire CLI builds May 20, 2026
Copy link
Copy Markdown
Contributor

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.

Pull request overview

Removes Aspire CLI’s explicit injection of DOTNET_CLI_USE_MSBUILD_SERVER into dotnet run and AppHost dotnet build process invocations, allowing the .NET SDK/environment to control MSBuild server behavior (avoiding failures seen with .NET SDK 10.0.300 on Linux).

Changes:

  • Removed the DOTNET_CLI_USE_MSBUILD_SERVER configuration/injection logic from DotNetCliRunner for RunAsync and BuildAsync.
  • Updated DotNetCliRunnerTests to assert that the CLI no longer injects DOTNET_CLI_USE_MSBUILD_SERVER (including when the setting is present in IConfiguration).
Show a summary per file
File Description
src/Aspire.Cli/DotNet/DotNetCliRunner.cs Stops injecting DOTNET_CLI_USE_MSBUILD_SERVER for dotnet run and dotnet build executions.
tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs Updates tests to validate the environment variable is no longer injected.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 136 to 140
[Fact]
public async Task BuildAsyncUsesConfigurationValueForDotnetCliUseMsBuildServer()
public async Task BuildAsyncDoesNotInjectConfiguredDotnetCliUseMsBuildServer()
{
using var workspace = TemporaryWorkspace.Create(outputHelper);
var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e42a708 by removing the outdated inline comment so the test description matches current behavior.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17313

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17313"

@davidfowl davidfowl enabled auto-merge (squash) May 20, 2026 15:25
@davidfowl
Copy link
Copy Markdown
Collaborator

/backport to release/13.3

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/13.3 (link to workflow run)

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

@davidfowl backporting to release/13.3 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Creating an empty commit: Initial plan
Applying: Stop forcing MSBuild server for CLI dotnet commands
Using index info to reconstruct a base tree...
M	src/Aspire.Cli/DotNet/DotNetCliRunner.cs
M	tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.Cli/DotNet/DotNetCliRunner.cs
Auto-merging tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs
CONFLICT (content): Merge conflict in tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Stop forcing MSBuild server for CLI dotnet commands
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

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.

[AspireE2E][Linux] After installing SDK 10.0.300, running an Aspire project fails with the error: "System.TimeoutException: The operation has timed out"

4 participants