Skip to content

Restore dotnet watch dashboard auto-launch signal - #17610

Merged
James Newton-King (JamesNK) merged 6 commits into
mainfrom
copilot/aspiree2e-fix-project-launch-issue
May 29, 2026
Merged

James Newton-King (JamesNK) merged 6 commits into
mainfrom
copilot/aspiree2e-fix-project-launch-issue

Conversation

Copilot AI commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

dotnet watch depends on the exact dashboard login log shape to detect when the AppHost is serving HTTP traffic and open the browser. Aspire 13.4 kept the login URL in the new dashboard summary, but no longer emitted the legacy line that dotnet watch recognizes.

  • Compatibility signal

    • Emit the legacy login line when a dashboard login URL is available:
      Login to the dashboard at https://localhost:17106/login?t=...
      
    • Document that the exact log template is a compatibility contract with dotnet watch.
  • Existing output preserved

    • Keep the new dashboard summary output, including Dashboard, Login URL, and OTLP endpoint lines.
  • Coverage

    • Added assertions for the shared dashboard logging helper.
    • Added AppHost dashboard-ready coverage for the emitted login URL.
    • Updated dashboard browser token log-output coverage to account for the restored legacy login line.

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: karolz-ms <15271049+karolz-ms@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix project not opening automatically in browser with dotnet watch Restore dotnet watch dashboard auto-launch signal May 28, 2026
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) marked this pull request as ready for review May 28, 2026 21:59
Copilot AI review requested due to automatic review settings May 28, 2026 21:59
@github-actions

github-actions Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

🚀 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 -- 17610

Or

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

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

Restores a legacy “Login to the dashboard at …” log line so dotnet watch can detect when the dashboard login URL is available and auto-launch a browser, while keeping the newer multi-line dashboard summary output intact.

Changes:

  • Emit an additional structured LogInformation line ("Login to the dashboard at {LoginUrl}") when a dashboard login URL can be constructed.
  • Update shared logging helper unit tests to assert the extra log entry and its structured payload.
  • Extend AppHost dashboard-ready test coverage to assert the legacy login line is emitted with the endpoint-resolved URL.

Reviewed changes

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

File Description
tests/Aspire.Hosting.Tests/Dashboard/DashboardEventHandlersTests.cs Adds assertions that the legacy login line is emitted and contains the expected resolved login URL.
tests/Aspire.Dashboard.Tests/LoggingHelpersTests.cs Updates expectations to account for the additional legacy login log entry and validates structured fields.
src/Shared/LoggingHelpers.cs Adds the legacy login LogInformation line when loginUrl is available, preserving existing summary logging.

@karolz-ms

Copy link
Copy Markdown
Contributor

Copilot looks like this change caused FrontendBrowserTokenAuthTests.LogOutput_NoToken_GeneratedTokenLogged to start failing. Investigate and fix.

Co-authored-by: karolz-ms <15271049+karolz-ms@users.noreply.github.com>

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Copilot looks like this change caused FrontendBrowserTokenAuthTests.LogOutput_NoToken_GeneratedTokenLogged to start failing. Investigate and fix.

Fixed in a5e6d63 by updating the browser token log-output assertion to expect the restored legacy login line before the dashboard summary. Targeted dashboard auth tests pass.

@JamesNK

Copy link
Copy Markdown
Member

Copilot resolve the merge conflicts in this pull request

Add a comment to logger.LogInformation("Login to the dashboard at {LoginUrl}", loginUrl); that this log message is used by dotnet watch and not to change it

Copilot AI and others added 2 commits May 29, 2026 03:11
Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>

Copilot AI commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

Add a comment to logger.LogInformation("Login to the dashboard at {LoginUrl}", loginUrl); that this log message is used by dotnet watch a...

Resolved the merge conflicts in f4215a7 and added the dotnet watch contract comment in b6aede9. Targeted dashboard tests pass.

Comment thread src/Shared/LoggingHelpers.cs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

❓ CLI E2E Tests unknown — 107 passed, 0 failed, 2 unknown (commit cfb8db4)

View all recordings
Status Test Recording Job Artifacts
✅ AddPackageInteractiveWhileAppHostRunningDetached Recording #78433006293 Logs
✅ AddPackageWhileAppHostRunningDetached Recording #78433006293 Logs
✅ AgentCommands_AllHelpOutputs_AreCorrect Recording #78433006297 Logs
✅ AgentInitCommand_DefaultSelection_InstallsDefaultSkills Recording #78433006297 Logs
✅ AgentInitCommand_MigratesDeprecatedConfig Recording #78433006297 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp Recording #78433006076 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost Recording #78433006076 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated Recording #78433006076 Logs
✅ AllPublishMethodsBuildDockerImages Recording #78433006247 Logs
✅ AspireAddAndStartWorkAgainstLegacyAppHostTs Recording #78433005968 Logs
✅ AspireAddPackageVersionToDirectoryPackagesProps Recording #78433006195 Logs
✅ AspireInitSingleFileAppHostRunsViaDotnetRunAppHost Recording #78433006201 Logs
✅ AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles Recording #78433006139 Logs
❔ AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive Recording #78433006139 Logs
✅ AspireStartUpdatesStaleTypeScriptAppHostPath Recording #78433006025 Logs
✅ AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps Recording #78433006195 Logs
✅ AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent Recording #78433006195 Logs
✅ Banner_DisplayedOnFirstRun Recording #78433005789 Logs
✅ Banner_DisplayedWithExplicitFlag Recording #78433005789 Logs
✅ Banner_NotDisplayedWithNoLogoFlag Recording #78433005789 Logs
✅ CertificatesClean_RemovesCertificates Recording #78433005980 Logs
✅ CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate Recording #78433005980 Logs
✅ CertificatesTrust_WithUntrustedCert_TrustsCertificate Recording #78433005980 Logs
✅ ConfigSetGet_CreatesNestedJsonFormat Recording #78433006088 Logs
✅ CreateAndRunAspireStarterProject Recording #78433006027 Logs
✅ CreateAndRunAspireStarterProjectWithBundle Recording #78433005946 Logs
✅ CreateAndRunEmptyAppHostProject Recording #78433006250 Logs
✅ CreateAndRunJavaEmptyAppHostProject Recording #78433006014 Logs
✅ CreateAndRunJsReactProject Recording #78433005963 Logs
✅ CreateAndRunPythonReactProject Recording #78433005863 Logs
✅ CreateAndRunTypeScriptEmptyAppHostProject Recording #78433005900 Logs
✅ CreateAndRunTypeScriptStarterProject Recording #78433005966 Logs
✅ CreateJavaAppHostWithViteApp Recording #78433006330 Logs
✅ CreateTypeScriptAppHostWithViteApp_AllowsGuestAppPackageManagerToDiffer Recording #78433005927 Logs
✅ CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain Recording #78433005927 Logs
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces Recording #78433006005 Logs
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost Recording #78433006005 Logs
✅ DashboardRunWithOtelTracesReturnsNoTraces Recording #78433006005 Logs
✅ DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost Recording #78433006005 Logs
✅ DeployK8sBasicApiService Recording #78433006001 Logs
✅ DeployK8sWithExternalHelmChart Recording #78433006110 Logs
✅ DeployK8sWithGarnet Recording #78433005908 Logs
✅ DeployK8sWithMongoDB Recording #78433006306 Logs
✅ DeployK8sWithMySql Recording #78433006348 Logs
✅ DeployK8sWithPostgres Recording #78433006318 Logs
✅ DeployK8sWithRabbitMQ Recording #78433006172 Logs
✅ DeployK8sWithRedis Recording #78433006226 Logs
✅ DeployK8sWithSqlServer Recording #78433005989 Logs
✅ DeployK8sWithValkey Recording #78433005945 Logs
✅ DeployTypeScriptAppToKubernetes Recording #78433006319 Logs
✅ DescribeCommandResolvesReplicaNames Recording #78433006292 Logs
✅ DescribeCommandShowsRunningResources Recording #78433006292 Logs
✅ DetachFormatJsonProducesValidJson Recording #78433006037 Logs
✅ DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance Recording #78433006037 Logs
✅ DoPublishAndDeployListStepsWork Recording #78433006322 Logs
✅ DocsCommand_RendersInteractiveMarkdownFromLocalSource Recording #78433006233 Logs
✅ DoctorCommand_DetectsDeprecatedAgentConfig Recording #78433006297 Logs
✅ DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain Recording #78433005853 Logs
✅ DoctorCommand_WithSslCertDir_ShowsTrusted Recording #78433005853 Logs
✅ DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted Recording #78433005853 Logs
✅ GatewayWithoutExternalEndpoint_FailsPublishWithGuidance Recording #78433006339 Logs
✅ GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain Recording #78433005927 Logs
✅ GlobalMigration_HandlesCommentsAndTrailingCommas Recording #78433006088 Logs
✅ GlobalMigration_HandlesMalformedLegacyJson Recording #78433006088 Logs
✅ GlobalMigration_PreservesAllValueTypes Recording #78433006088 Logs
✅ GlobalMigration_SkipsWhenNewConfigExists Recording #78433006088 Logs
✅ GlobalSettings_MigratedFromLegacyFormat Recording #78433006088 Logs
✅ IngressWithoutExternalEndpoint_FailsPublishWithGuidance Recording #78433006339 Logs
✅ InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory Recording #78433005927 Logs
✅ InteractiveCSharpInitCreatesExpectedFiles Recording #78433006140 Logs
✅ InvalidAppHostPathWithComments_IsHealedOnRun Recording #78433006304 Logs
✅ JavaScriptHostingApisRunFromTypeScriptAppHost Recording #78433006247 Logs
✅ LatestCliCanStartStableChannelAppHost Recording #78433006027 Logs
✅ LatestCliCanStartStableChannelTypeScriptAppHost Recording #78433006027 Logs
✅ LegacySettingsMigration_AdjustsRelativeAppHostPath Recording #78433006025 Logs
✅ LogsCommandShowsResourceLogs Recording #78433006232 Logs
✅ OtelLogsReturnsStructuredLogsFromStarterApp Recording #78433006052 Logs
✅ OtelLogsReturnsStructuredLogsFromStarterAppIsolated Recording #78433006052 Logs
✅ PsCommandListsRunningAppHost Recording #78433005981 Logs
✅ PsFormatJsonOutputsOnlyJsonToStdout Recording #78433005981 Logs
✅ PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts Recording #78433006137 Logs
✅ PublishWithConfigureEnvFileUpdatesEnvOutput Recording #78433006137 Logs
✅ PublishWithDockerComposeServiceCallbackSucceeds Recording #78433006137 Logs
✅ PublishWithoutOutputPathUsesAppHostDirectoryDefault Recording #78433006137 Logs
✅ ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries Recording #78433006278 Logs
✅ ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput Recording #78433006278 Logs
✅ RestoreGeneratesSdkFiles Recording #78433006044 Logs
✅ RestoreGeneratesSdkFiles_WithConfiguredToolchain Recording #78433006101 Logs
✅ RestoreRefreshesGeneratedSdkAfterAddingIntegration Recording #78433006101 Logs
✅ RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes Recording #78433005939 Logs
✅ RunFromParentDirectory_UsesExistingConfigNearAppHost Recording #78433005890 Logs
✅ RunReportsSyntaxErrorsForDotNetAppHost Recording #78433006251 Logs
✅ RunReportsSyntaxErrorsForTypeScriptAppHost Recording #78433006251 Logs
✅ SecretCrudOnDotNetAppHost Recording #78433006046 Logs
✅ SecretCrudOnTypeScriptAppHost Recording #78433006077 Logs
✅ StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels Recording #78433006334 Logs
✅ StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets Recording #78433006103 Logs
✅ StartReportsSyntaxErrorsForDotNetAppHost Recording #78433006251 Logs
✅ StartReportsSyntaxErrorsForTypeScriptAppHost Recording #78433006251 Logs
✅ StopAllAppHostsFromAppHostDirectory Recording #78433005786 Logs
✅ StopJavaPolyglotAppHostUsingApphostDirectory Recording #78433006119 Logs
✅ StopNonInteractiveSingleAppHost Recording #78433005786 Logs
✅ StopTypeScriptPolyglotAppHostUsingApphostDirectory Recording #78433006096 Logs
✅ StopWithNoRunningAppHostExitsSuccessfully Recording #78433006293 Logs
✅ UnAwaitedChainsCompileWithAutoResolvePromises Recording #78433006101 Logs
❔ UpdateProjectChannelToStable_CSharpEmptyAppHost_PreservesAspireConfigChannel Recording #78433006321 Logs
✅ UpdateProjectChannelToStable_CSharpSingleFileInit_PreservesAspireConfigChannel Recording #78433006321 Logs
✅ UpdateProjectChannelToStable_TypeScriptSingleFileInit_PreservesAspireConfigChannel Recording #78433006321 Logs
✅ UpdateProjectChannelToStable_TypeScript_PreviewsStablePackagesAndPreservesChannel Recording #78433006321 Logs

📹 Recordings uploaded automatically from CI run #26615995178

@JamesNK
James Newton-King (JamesNK) merged commit ad839e2 into main May 29, 2026
311 checks passed
@JamesNK
James Newton-King (JamesNK) deleted the copilot/aspiree2e-fix-project-launch-issue branch May 29, 2026 07:21
@JamesNK

Copy link
Copy Markdown
Member

/backport to release/13.4

@microsoft-github-policy-service microsoft-github-policy-service Bot modified the milestones: 13.4, 13.5 May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

James Newton-King (@JamesNK) backporting to release/13.4 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: Emit dashboard login line for dotnet watch
Applying: Fix dashboard browser token log test
Applying: Clarify dotnet watch login log contract
Using index info to reconstruct a base tree...
M	src/Shared/LoggingHelpers.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Shared/LoggingHelpers.cs
CONFLICT (content): Merge conflict in src/Shared/LoggingHelpers.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 0004 Clarify dotnet watch login log contract
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AspireE2E] This project cannot be opened automatically in the browser when running the Aspire 13.4 project with dotnet watch

5 participants