-
Notifications
You must be signed in to change notification settings - Fork 82
[docs] Document project serverReadyAction override in VS Code extension #1459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/13.5
Are you sure you want to change the base?
Changes from all commits
2e8a9a7
61065d8
6a5a194
98c395d
4a97126
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,25 @@ All of these commands are debuggable; you can step into custom publishers and de | |
|
|
||
| The `debuggers` property forwards configuration to specific debuggers. Recognized keys are: `apphost`, `project` (C#/.NET), `node`, `python`, `browser`, and `azure-functions`. | ||
|
|
||
| For `project`, the extension normally generates a `serverReadyAction` from the project's `launchSettings.json` to automatically open the browser when the server is ready. Set `debuggers.project.serverReadyAction` explicitly to override this generated default with your own action and pattern: | ||
|
|
||
|
ellahathaway marked this conversation as resolved.
|
||
| :::note[AppHost behavior] | ||
| A .NET AppHost also uses the `project` debugger, so `debuggers.project.serverReadyAction` is included in its debug configuration. If you set both `debuggers.apphost.serverReadyAction` and `debuggers.project.serverReadyAction`, the `project` value takes precedence. | ||
| ::: | ||
|
|
||
| ```json title=".vscode/launch.json — override debuggers.project.serverReadyAction" | ||
| { | ||
| "debuggers": { | ||
| "project": { | ||
| "serverReadyAction": { | ||
|
ellahathaway marked this conversation as resolved.
|
||
| "action": "openIntegratedBrowser", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "pattern": "\\bNow listening on:\\s+(https?://\\S+)" | ||
| } | ||
|
ellahathaway marked this conversation as resolved.
|
||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Finally, you can specify `env` and `args` to set environment variables and command-line arguments for the AppHost process. | ||
|
|
||
| ```json title=".vscode/launch.json — deploy with debugger settings, env, and args" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contradicted on
release/13.5. This paragraph says a user can override the generated default, but on this branch that override is discarded for project resources. Inextension/src/debugger/debuggerExtensions.ts:51-78the user'sdebuggers.project(includingserverReadyAction) is merged into the debug configuration before the .NET callback runs; thenextension/src/debugger/languages/dotnet.ts:451-452unconditionally reassignsserverReadyAction = determineServerReadyAction(...)for every non-AppHost project, overwriting the user value. The guard that preserves an explicitly-configured value only exists onmain(dotnet.tscomment: "A serverReadyAction the user configured explicitly in launch.json is still respected … never overwritten here"), where the extension also no longer generates one fromlaunchSettings.jsonat all. So onrelease/13.5this describes behavior that doesn't ship yet — retarget to the release carrying microsoft/aspire#19200, or hold until it lands onrelease/13.5.(Note: the override does survive for the AppHost, because
dotnet.ts:451skips the generated action whenisApphost— which is why the AppHost note below is accurate. But the "override this generated default" scenario is the project case, where it's overwritten.)