Stop forcing MSBuild server for Aspire CLI builds#17313
Conversation
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
There was a problem hiding this comment.
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_SERVERconfiguration/injection logic fromDotNetCliRunnerforRunAsyncandBuildAsync. - Updated
DotNetCliRunnerTeststo assert that the CLI no longer injectsDOTNET_CLI_USE_MSBUILD_SERVER(including when the setting is present inIConfiguration).
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
| [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")); |
There was a problem hiding this comment.
Fixed in e42a708 by removing the outdated inline comment so the test description matches current behavior.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17313Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17313" |
|
/backport to release/13.3 |
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
|
Started backporting to |
|
@davidfowl backporting to 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 |
Description
aspire runcan 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
DOTNET_CLI_USE_MSBUILD_SERVERfordotnet run/dotnet buildinvocations.Tests
DotNetCliRunnercoverage to assert the CLI no longer injectsDOTNET_CLI_USE_MSBUILD_SERVER.Checklist
<remarks />and<code />elements on your triple slash comments?