Skip to content

Templates: restore the (Unpackaged) profile on packaged apps, fix Reactor devtools profile - #6954

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-fix-template-launch-profiles
Nov 6, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-fix-template-launch-profiles

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes three problems the dotnet new templates on main would ship in 0.0.8-alpha (#6953 bumped the version).

1. dotnet run warns on every packaged scaffold

Since #6905, packaged scaffolds of all nine app and test templates (winui, winui-mvvm, winui-navview, winui-tabview, winui-unittest, reactor, reactor-mvu, reactor-navview, reactor-tabview) get only "<name> (Package)" (commandName: MsixPackage). Without --launch-profile, dotnet run applies the first profile whose commandName is Project or Executable (dotnet/sdk LaunchSettings.ReadProfileSettingsFromFile). None qualifies, so every run prints the following before launching anyway:

The launch profile "(Default)" could not be applied.
A usable launch profile could not be located.

This restores the profile pair packaged scaffolds had before #6905. (Package) stays first, so it remains the Visual Studio F5 default, and (Unpackaged) (Project) follows it. dotnet run now applies (Unpackaged), and Microsoft.Windows.SDK.BuildTools.WinApp still launches the app with package identity. Unpackaged scaffolds are unchanged.

Known limitation, to be fixed separately. 0.0.7-alpha and the former VSIX templates had the same issue. For a Project profile, Visual Studio starts TargetPath directly and doesn't run ComputeRunArguments. Choosing (Unpackaged) on a packaged project in Visual Studio therefore starts the exe without package identity. The app then fails at startup with REGDB_E_CLASSNOTREG from the DeploymentManager auto-initializer.

2. The Reactor devtools profile passed a bare --devtools

Reactor reads a bare --devtools as --devtools run, which starts the devtools MCP-server session. The (Unpackaged, Devtools) profile now passes --devtools app. That only sets ReactorApp.DevtoolsEnabled, which DevtoolsMenu(...) and UseDevtools() read. The profile stays on unpackaged scaffolds only: dotnet run ignores a profile's commandLineArgs when the project sets RunArguments, and WinApp sets them for packaged apps. For packaged apps, use dotnet run -- --devtools app.

3. The Reactor csproj comment described a devtools menu that doesn't exist

The comment on the Debug-only ItemGroup said a "devtools F5 profile lights up the devtools menu". No template renders DevtoolsMenu(...), and packaged scaffolds had no such profile. The comment now says what the ItemGroup does. It references Microsoft.UI.Reactor.Devtools and turns on Reactor.DevtoolsSupport, which makes devtools available. Launching with --devtools app turns them on, and rendering DevtoolsMenu(...) shows the menu. (The XML comment says "the devtools "app" subcommand" because XML comments can't contain --.)

Test-DotnetNewTemplates.ps1 now checks that packaged scaffolds list MsixPackage first and include a Project profile, and that unpackaged Reactor scaffolds pass --devtools app (a bare --devtools fails the check). The template README describes the profiles and devtools.

Generated launch profiles

Scaffold Profiles, in order
Packaged, all nine templates <name> (Package): MsixPackage
<name> (Unpackaged): Project
Unpackaged XAML apps and unit tests <name> (Unpackaged): Project
Unpackaged Reactor apps <name> (Unpackaged): Project
<name> (Unpackaged, Devtools): Project, commandLineArgs: --devtools app

Validation

On .NET SDK 10.0.403, with the template pack installed into an isolated DOTNET_CLI_HOME and package cache:

  • Packed the template project and scaffolded all nine templates, Packaged and Unpackaged. All 18 projects build for x64 Debug with 0 warnings and 0 errors.
  • Ran dotnet run -c Debug -p:Platform=x64 on all 18. None printed a launch-profile warning. Packaged apps, winui-unittest included, ran with package identity (checked with GetPackageFullName); unpackaged apps ran without it. On main, the same command printed the warning for packaged winui and reactor scaffolds.
  • Reactor (Unpackaged, Devtools): the app's command line ends in --devtools app, and no devtools MCP session starts. A bare --devtools prints [devtools] MCP serving on http://127.0.0.1:<port>/mcp.
  • dotnet run -- --devtools app reaches all four packaged Reactor apps.
  • Ran the script's Test-PackagingOptions locally on x64 for the eight app templates, including the unpackaged publish-and-launch smoke, and all passed. That run didn't use the script's Set-StrictMode -Version 2.0, so it missed a strict-mode error in the new profile-args check, which the first Templates-PR run caught. The second commit fixes it, and reactor and winui pass again under strict mode. The updated checks fail on main's profile sets.
  • To confirm the Visual Studio limitation above, I launched a packaged scaffold's bin exe directly, as Visual Studio does for a Project profile. Both winui and reactor exited with 0xE0434352 (COMException 0x80040154 REGDB_E_CLASSNOTREG in DeploymentManagerAutoInitializer).

…ctor devtools profile

Packaged scaffolds of all nine app and test templates only got the
MsixPackage profile after #6905, so every `dotnet run` printed "A usable
launch profile could not be located": dotnet run can only apply Project
or Executable profiles. Restore the pre-#6905 (Package) + (Unpackaged)
pair, keeping (Package) first as the Visual Studio F5 default. WinApp
still launches the app with package identity under dotnet run.

Make the Reactor "(Unpackaged, Devtools)" profile pass `--devtools app`;
a bare `--devtools` means `--devtools run`, which starts the MCP-server
session. Reword the Reactor csproj comment that promised a devtools F5
profile and menu, and update the template tests and README.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azchohfi

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Alexandre Zollinger Chohfi (azchohfi) added a commit to microsoft/microsoft-ui-reactor that referenced this pull request Nov 6, 2026
The next pack's launch profiles follow microsoft/WindowsAppSDK#6954,
the set the user chose:
- Packaged scaffolds list (Package) first, Visual Studio's F5 default,
  then (Unpackaged).
- Unpackaged scaffolds keep (Unpackaged) and (Unpackaged, Devtools). The
  Devtools profile now passes `--devtools app`, so the old caveat against
  picking it for the dev menu is gone.

The reactor-getting-started skill now also says:
- `dotnet run` picks (Unpackaged) on a packaged scaffold, because it
  skips the MSIX profile, and WinApp still launches with package
  identity.
- Under `dotnet run`, a packaged scaffold ignores profile arguments, so
  devtools come from `dotnet run -- --devtools app`.
- Visual Studio users should keep (Package). (Unpackaged) starts a
  packaged scaffold without identity, and it fails with
  REGDB_E_CLASSNOTREG.

Checked against #6954's diff (all four Reactor templates make the same
change) and dotnet/sdk: the default profile is the first one with a
supported commandName, and profile commandLineArgs apply only when the
command has no arguments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Test-DotnetNewTemplates.ps1 runs with Set-StrictMode -Version 2.0, so
reading commandLineArgs from a launch profile that doesn't define it threw
"The property 'commandLineArgs' cannot be found on this object" in the
Templates-PR smoke test.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azchohfi

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 43bd02c into main Nov 6, 2026
56 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the azchohfi-fix-template-launch-profiles branch November 6, 2026 08:10
Alexandre Zollinger Chohfi (azchohfi) added a commit to microsoft/microsoft-ui-reactor that referenced this pull request Nov 11, 2026
…ce (#1465)

* Describe Windows App SDK template pack 0.0.8-alpha in docs and guidance

The next Windows App SDK template pack (microsoft/WindowsAppSDK#6845) adds a
reactor-singlefile template and a --packaging Packaged|Unpackaged option, and
its Reactor scaffolds no longer reference the Microsoft.WindowsAppSDK
metapackage (--wasdk-version is gone). Launch profiles now follow the packaging
mode.

Update the Getting Started and Packaging guides, README, SKILL.md, the agent
plugin, and bootstrap.ps1's closing guidance to match, and assert
reactor-singlefile in the bootstrap workflow. Bootstrap only names
reactor-singlefile when the installed pack provides it, because it keeps an
already-installed older pack.

Must not merge until the pack is on NuGet.org.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Point the getting-started skill at --devtools app, not the Devtools profile

A bare --devtools is parsed as --devtools run (DevtoolsCliParser.ParseSubverbAfter),
which starts the devtools logger and MCP server rather than only enabling the
in-app dev menu. The Unpackaged scaffold's "(Unpackaged, Devtools)" profile passes
exactly that, so the skill now matches #1464: run `dotnet run -- --devtools app`
for the dev menu, and don't pick that profile just for it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Warn instead of failing on reactor-singlefile before pack 0.0.8

The Verify step asserted reactor-singlefile unconditionally, so it failed on
every run until template pack 0.0.8-alpha is the newest on NuGet.org: it
checked the pack's release date rather than what bootstrap installed. Read the
installed pack's version and require the template only from 0.0.8 on; an older
pack gets a warning annotation, and an unreadable version fails closed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address pr-review findings

- bootstrap.ps1: run the closing reactor-singlefile probe under a
  block-scoped 'Continue'. With no match, `dotnet new list` writes to
  stderr and exits 103. Windows PowerShell 5.1 turns redirected native
  stderr into error records, which the script-wide 'Stop' made
  terminating, so bootstrap died with exit 1 after "Bootstrap complete."
  on every machine whose pack predates reactor-singlefile.
- BootstrapExitCode.Tests.ps1 case 9: run the probe's own statements,
  lifted from the AST, against dotnet.cmd shims on both legs. The
  match/no-match pair is a differential check, and on 5.1 the pre-fix
  line is the positive control.
- Agent-facing guidance (root SKILL.md, reactor-getting-started skill,
  reactor-dev agent): say how to update a pack that predates
  `--packaging` and reactor-singlefile, matching the getting-started
  guide.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address review round 1

A reactor-singlefile scaffold reached the reactor-dev agent's steps 4-5,
which assume App.cs and a bare `mur check`. That runs `dotnet build .`,
which needs a project file, so it exited 1 with no output even on an
untouched scaffold. The agent's steps 4-5 and the reactor-getting-started
single-file paragraph now say to keep all code in <Name>.cs and to check
it with `mur check <Name>.cs`.

Measured on a reactor-singlefile scaffold from the next pack, on SDKs
10.0.403 and 11.0.100-rc.3:
- `mur check <Name>.cs` exits 0.
- An injected typo gives CS0103 plus a did-you-mean hint, exit 1.
- A sibling .cs file is not compiled in (CS0103).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address review round 2

`dotnet run -- --devtools app` does not light up a dev menu by itself.
It only sets ReactorApp.DevtoolsEnabled, which is read only by
UseDevtools() and DevtoolsMenu(...), and no Reactor template renders the
menu (0 of 4 in the published 0.0.7-alpha, 0 of 5 in the next pack). The
reactor-getting-started skill now uses #1464's wording: run with
`--devtools app` and render DevtoolsMenu(...), because the flag alone
draws nothing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Describe the launch profiles from microsoft/WindowsAppSDK#6954

The next pack's launch profiles follow microsoft/WindowsAppSDK#6954,
the set the user chose:
- Packaged scaffolds list (Package) first, Visual Studio's F5 default,
  then (Unpackaged).
- Unpackaged scaffolds keep (Unpackaged) and (Unpackaged, Devtools). The
  Devtools profile now passes `--devtools app`, so the old caveat against
  picking it for the dev menu is gone.

The reactor-getting-started skill now also says:
- `dotnet run` picks (Unpackaged) on a packaged scaffold, because it
  skips the MSIX profile, and WinApp still launches with package
  identity.
- Under `dotnet run`, a packaged scaffold ignores profile arguments, so
  devtools come from `dotnet run -- --devtools app`.
- Visual Studio users should keep (Package). (Unpackaged) starts a
  packaged scaffold without identity, and it fails with
  REGDB_E_CLASSNOTREG.

Checked against #6954's diff (all four Reactor templates make the same
change) and dotnet/sdk: the default profile is the first one with a
supported commandName, and profile commandLineArgs apply only when the
command has no arguments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Verify against the published 0.0.8-alpha template pack

Published 0.0.8-alpha (WindowsAppSDK bdc0deb7) also scaffolds AGENTS.md and
.vscode/ in every project template, so list them with the other scaffold
files in both SKILL.md copies. Bootstrap CI now installs 0.0.8-alpha, so the
reactor-singlefile assertion no longer needs its pre-ship version gate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants