Fix AspireHostLauncher not launching the Aspire host#53877
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes AspireHostLauncher so the Aspire host project is actually launched (by providing MainProjectOptions to the watcher), and strengthens tests to detect regressions.
Changes:
- Pass host
ProjectOptionsintoDotNetWatchContext.MainProjectOptionswhen launching the Aspire watcher. - Adjust
AspireHostLauncher/tests to use the new project-options flow (GetHostProjectOptionswrapper for testing). - Update the Aspire launcher end-to-end test to assert the host app outputs
Started.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/AspireLauncherTests.cs | Adds a runtime-output assertion (Started) to confirm the host app is actually launched. |
| test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/AspireHostLauncherTests.cs | Updates tests to call the new host project-options accessor. |
| src/Dotnet.Watch/Watch.Aspire/Server/AspireWatcherLauncher.cs | Wires MainProjectOptions from an overridable GetProjectOptions() to enable main-project launching. |
| src/Dotnet.Watch/Watch.Aspire/Host/AspireHostLauncher.cs | Implements GetProjectOptions() override so the host launch supplies MainProjectOptions. |
Comments suppressed due to low confidence (1)
test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/AspireHostLauncherTests.cs:51
GetHostProjectOptions()returns a non-nullProjectOptions, so the null-forgiving operator (!) is redundant here (and can hide nullability issues if the signature changes later). Consider removing the!(and similarly in the other occurrences in this file once the underlying return type is non-null).
var options = launcher.GetHostProjectOptions()!;
AssertCommonProperties(options, launcher);
Assert.False(options.LaunchProfileName.HasValue);
AssertEx.SequenceEqual(["--project", "myapp.csproj", "--no-launch-profile"], options.CommandArguments);
|
/ba-g Unrelated issues. Copilot analysis: The CI has two distinct categories of test failures, all across 5 legs (Windows/Linux/macOS):
Tracked by #53869 (#53869) ([Known Build Error]). Affects
These tests fail because dotnet run now outputs "Using launch settings from ...launchSettings.json..." to stderr,
These are not tracked by any existing [Known Build Error] issue in dotnet/sdk. They appear to be a pre-existing |
|
/backport to release/10.0.3xx |
|
Started backporting to |
No description provided.