Skip to content

Add Reactor (Microsoft.UI.Reactor) dotnet new templates#6620

Open
azchohfi wants to merge 6 commits into
mainfrom
azchohfi-reactor-dotnet-new-templates
Open

Add Reactor (Microsoft.UI.Reactor) dotnet new templates#6620
azchohfi wants to merge 6 commits into
mainfrom
azchohfi-reactor-dotnet-new-templates

Conversation

@azchohfi

@azchohfi azchohfi commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Adds four Reactor (Microsoft.UI.Reactor) project templates to the existing Microsoft.WindowsAppSDK.WinUI.CSharp.Templates dotnet new pack, mirroring the WinUI templates from #6407 but for Reactor's declarative, pure-C# (no XAML) model.

Template Short names What it scaffolds
Reactor Blank App reactor, reactor-blank Minimal Hello-World Reactor app
Reactor MVU App reactor-mvu Model-View-Update counter using UseReducer
Reactor NavigationView App reactor-navview NavigationView shell with multiple pages
Reactor TabView App reactor-tabview TabView shell with multiple tabs

What changed

  • dev/Templates/templates.props — four new rows in the DotnetNewOnlyProjectTemplate slot (dotnet-new only, no VSIX). Reactor apps run unpackaged, so there is no Package.appxmanifest (RenameManifestFrom left unset). This reuses the repo's existing single-source-of-truth pack pipeline.
  • dev/Templates/Source/ProjectTemplates/Desktop/CSharp/Reactor* — the app sources: a shared ProjectTemplate.csproj (references Microsoft.UI.Reactor + Microsoft.WindowsAppSDK, WindowsAppSDKSelfContained, Debug-only Reactor devtools), a single-file App.cs per pattern, and Properties/launchSettings.json (default + Devtools F5 profiles).
  • dev/Templates/Dotnet/templates/reactor-* — the .template.config for each (template.json, dotnetcli.host.json, ide.host.json, icon.png). Defaults: Reactor 0.1.0-preview.12, Windows App SDK 2.1.3, net10.0; overridable via --reactor-version / --wasdk-version.
  • dev/Templates/Dotnet/README.md — documents the new Reactor templates.
  • dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1 — adds the four to the scaffold/build validation loop.

Validation

Validated end-to-end against the live Microsoft.UI.Reactor 0.1.0-preview.12: dotnet packdotnet new install → all four register → dotnet newdotnet build (Debug + Release) → dotnet run. All four launch cleanly, including the title-bar app-mark icon (which relies on the IconResolver fix from microsoft/microsoft-ui-reactor#855, shipped in preview.12).


A Microsoft employee must use /azp run to validate using the PR pipelines.

azchohfi and others added 3 commits July 13, 2026 11:53
Adds four Reactor project templates to the Microsoft.WindowsAppSDK.WinUI.CSharp.Templates dotnet-new pack, mirroring the WinUI templates but for Microsoft.UI.Reactor (pure C#, no XAML):

- Reactor Blank App        (reactor, reactor-blank)
- Reactor MVU App          (reactor-mvu)
- Reactor NavigationView   (reactor-navview)
- Reactor TabView App      (reactor-tabview)

Wired into dev/Templates/templates.props via the DotnetNewOnlyProjectTemplate
slot (dotnet-new only, no VSIX, no manifest; Reactor apps run unpackaged).
Each shares a common csproj referencing Microsoft.UI.Reactor +
Microsoft.WindowsAppSDK, bundles the WinAppSDK runtime self-contained, and
enables the Debug-only Reactor devtools surface. README and
Test-DotnetNewTemplates.ps1 updated to document and validate the new templates.

Validated end-to-end: pack -> install -> dotnet new -> build (Debug + Release)
for all four templates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
TitleBar(...).Icon(FontIcon(...)) threw System.ArgumentException (E_INVALIDARG)
at runtime when Reactor set TitleBar.IconSource on Windows App SDK 2.1.3, so
the scaffolded Blank, MVU, and TabView apps crashed on launch. The glyph was
only a placeholder, so drop the icon; the title bar still shows the title text
and all four templates now launch cleanly (validated with dotnet run).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
microsoft/microsoft-ui-reactor#855 fixes the IconResolver FontSize=NaN crash
(FontIcon in an IconSource slot without an explicit size threw
ArgumentException from TitleBar.set_IconSource). That fix ships in
Microsoft.UI.Reactor 0.1.0-preview.12, so restore the placeholder title-bar
app-mark icon in the Blank, MVU, and TabView templates and bump the default
reactorVersion 0.1.0-preview.11 -> 0.1.0-preview.12 across all four templates.

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
azchohfi marked this pull request as ready for review July 15, 2026 05:01
@azure-pipelines

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

@beth-panx
beth-panx requested review from DinahK-2SO and Scottj1s July 23, 2026 20:46
@azchohfi

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

The template smoke-test stage installed only .NET SDK 8.0.x, so scaffolding
and building the Reactor templates failed with NETSDK1045 (Reactor targets
net10.0 and declares a [10.0,) sdk-version constraint). The WinUI templates
auto-detect their TFM from the active SDK, so they built net8.0 and passed,
masking the gap.

Add a second UseDotNet@2 step (param reactorDotnetSdkVersion, default 10.0.x)
to the shared Test-Stage template so the agent has the .NET 10 SDK. Verified
locally that the WinUI templates still build cleanly on the .NET 10 SDK, so
existing coverage is unaffected. Both the official and PR pipelines consume
this shared stage.

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

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@@ -0,0 +1,18 @@
{
"//": "Default F5 / `dotnet run` profiles for the scaffolded Reactor app.",

@DinahK-2SO DinahK-2SO Jul 24, 2026

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.

Why are we having these comments in launchsettings.json files? Some of these contents overlap with those in the package's README.

Can we remove them?

<Platforms>x64;ARM64;x86</Platforms>
<UseWinUI>true</UseWinUI>
<!-- Reactor apps run unpackaged. -->
<WindowsPackageType>None</WindowsPackageType>

@DinahK-2SO DinahK-2SO Jul 24, 2026

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.

Why not make them packaged apps? Dotnet run supports packaged apps now.

@azchohfi You can reference the existing winui templates, when you launch them, there will be an app id.

For instance,
Image

@@ -0,0 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk">

@DinahK-2SO DinahK-2SO Jul 24, 2026

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.

Missing taskbar icons in all new templates.

Image

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.

Should use the special icon for navigation view here.

Image

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.

Should use the special icon for tab view here~

Image

{
public override Element Render()
{
var (selectedIndex, setSelectedIndex) = UseState(0);

@DinahK-2SO DinahK-2SO Jul 24, 2026

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.

Hi @azchohfi, can we integrate the tabs into the title bar? That would be cleaner and save some vertical space.

You can reference the winui-tabview template about the config.
image

in contrast, the current reactor-tabview is stacking tabs below title bar:
image

"identity": "Microsoft.WindowsAppSDK.Reactor.CSharp.BlankApp",
"groupIdentity": "Microsoft.WindowsAppSDK.Reactor.CSharp.BlankApp",
"name": "Reactor Blank App",
"shortName": [ "reactor", "reactor-blank" ],

@DinahK-2SO DinahK-2SO Jul 24, 2026

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.

Right now these new templates will be found by "dotnet new list reactor".

Can we also have some short names starts with "winui-"? like,

"shortName": [
  "reactor",
  "reactor-blank",
  "winui-reactor"
]

so that our users can see there're new templates when they run "dotnet new list winui" command with the new package?

@azchohfi, @niels9001 , @Scottj1s , @beth-panx How do you like this suggestion?

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