Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fc86e0b
Add Reactor (Microsoft.UI.Reactor) dotnet new templates
azchohfi Jul 13, 2026
7079826
Fix Reactor template runtime crash: remove TitleBar icon
azchohfi Jul 13, 2026
572c23a
Bump Reactor templates to preview.12 and restore title-bar icon
azchohfi Jul 15, 2026
e31aed3
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Jul 15, 2026
cc5a9b1
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Jul 22, 2026
a6bc434
Provision .NET 10 SDK in dotnet-new templates test stage
azchohfi Jul 23, 2026
5d76a37
Address PR review: trim launchSettings comments, use per-template icons
azchohfi Jul 24, 2026
47bcf4f
Add winui-reactor* short-name aliases to Reactor templates
azchohfi Jul 24, 2026
c15e219
reactor-tabview: integrate tabs into the title bar
azchohfi Jul 24, 2026
94e206a
Make Reactor templates packaged (MSIX) and match the WinUI templates
azchohfi Jul 24, 2026
74f8df0
reactor-mvu: greet 'Hello, Reactor!'; use WinUI type-ramp styles for …
azchohfi Jul 24, 2026
768ac67
reactor-tabview: give tab pages a solid background to match WinUI
azchohfi Jul 24, 2026
cbeb825
reactor-tabview: stretch the tab page surface to fill the content area
azchohfi Jul 24, 2026
bb5bc93
Fill reactor-tabview page surface to window height
azchohfi Jul 24, 2026
cdee0c2
Use Reactor's navigation system in reactor-navview
azchohfi Jul 27, 2026
6b4aebf
Toggle the nav pane on the control instead of mirrored state
azchohfi Jul 27, 2026
2898bec
Match the WinUI page transition in reactor-navview
azchohfi Jul 27, 2026
9dc32b9
Trim the Reactor templates to match the XAML templates' style
azchohfi Jul 27, 2026
d0b3e47
Mark the Reactor templates as experimental
azchohfi Jul 27, 2026
37fe726
Fix Reactor analyzer warnings in the MVU and TabView templates
azchohfi Jul 27, 2026
6ee1260
Use $targetentrypoint$ in the Reactor manifests, like the XAML templates
azchohfi Jul 28, 2026
61fb3c7
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Jul 30, 2026
8ea4586
Commit the Reactor templates' publish profiles
azchohfi Jul 30, 2026
f818c19
Stop .gitignore from swallowing template publish profiles
azchohfi Jul 30, 2026
f3f78bd
Match the XAML templates' icon font and size
azchohfi Aug 4, 2026
7542f2e
Update Reactor dotnet new templates for 0.1.0-preview.13
azchohfi Jul 30, 2026
e91d7b3
Let the OS size the window, like the XAML templates
azchohfi Aug 4, 2026
a3eedf0
Add the MsixPackage launch profile to the Reactor templates
azchohfi Aug 5, 2026
5c43a94
Float the Windows App SDK version in the Reactor templates
azchohfi Aug 5, 2026
3c8c640
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Aug 20, 2026
5ff625e
Accept MSB4181 for the invalid-version restore test on .NET SDK 10
azchohfi Aug 25, 2026
3498b5d
Pin the Reactor test-stage .NET SDK instead of floating 10.0.x
azchohfi Aug 25, 2026
0835b70
Accept NETSDK1005 for the invalid-version build test on .NET SDK 10
azchohfi Aug 25, 2026
3df1efe
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Aug 26, 2026
5cc535b
Merge branch 'main' into azchohfi-reactor-dotnet-new-templates
azchohfi Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,6 @@ build/override/
# WindowsAppSDK specific files
Microsoft.WinUI.AppX.targets
!dev/vsix/**/*.pubxml
# Project templates ship publish profiles as template content, so they must be
# committed despite the blanket *.pubxml rule above.
!dev/Templates/**/*.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ parameters:
- name: dotnetSdkVersion
type: string
default: '8.0.x'
# Reactor project templates target net10.0 and declare a [10.0,) SDK
# constraint, so the test agent also needs the .NET 10 SDK to scaffold and
# build them. Installed alongside dotnetSdkVersion below.
#
# Pinned to an exact version rather than '10.0.x', matching every other
# UseDotNet@2 task in this repo (see WindowsAppSDK-BuildVSIX-Steps.yml, #6624
# and #6699). A floating '10.0.x' silently jumped feature bands when 10.0.400
# shipped on 2026-08-11, which changed the NuGet diagnostic for an unparseable
# package version and broke the invalid-version smoke test with no source
# change. Bump this deliberately, as #6699 did.
#
# NOTE: this must stay on the 10.0.4xx band, and cannot be aligned with the
# 10.0.1xx servicing SDK used by BuildVSIX. Microsoft.UI.Reactor's analyzers
# and source generators (Reactor.Analyzers, Reactor.Wrappers.Generator,
# Reactor.Localization.Generator) reference Roslyn 5.6.0.0. The 10.0.1xx band
# ships Roslyn 5.0.0.0, so all three are silently disabled with CS9057 while
# the build still succeeds. 10.0.400 ships Roslyn 5.9.0.0 and loads them.
- name: reactorDotnetSdkVersion
type: string
default: '10.0.400'
- name: WindowsAppSdkVersion
type: string
default: '*'
Expand Down Expand Up @@ -68,6 +88,16 @@ stages:
packageType: sdk
version: '${{ parameters.dotnetSdkVersion }}'

# Reactor templates require the .NET 10 SDK (they target net10.0 and set a
# [10.0,) sdk-version constraint). Install it alongside the version above;
# the .NET muxer picks the highest installed SDK, and the WinUI templates
# auto-detect their TFM and build cleanly on .NET 10 as well.
- task: UseDotNet@2
displayName: 'Use .NET SDK ${{ parameters.reactorDotnetSdkVersion }} (for Reactor templates)'
inputs:
packageType: sdk
version: '${{ parameters.reactorDotnetSdkVersion }}'

- task: NuGetAuthenticate@1
displayName: 'Authenticate NuGet feeds'

Expand Down
50 changes: 50 additions & 0 deletions dev/Templates/Dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,40 @@ Get below list via `dotnet new list winui`

Each `winui-*` short name also has a `winui3-*` alias (e.g. `winui3-mvvm`).

### Reactor Templates (Experimental)

> [!IMPORTANT]
> These templates are **experimental**.
> [Microsoft.UI.Reactor](https://github.com/microsoft/microsoft-ui-reactor) is
> prerelease software: its API may change in breaking ways between releases, and
> these templates may change or be removed. They aren't recommended for
> production apps yet.

[Microsoft.UI.Reactor](https://github.com/microsoft/microsoft-ui-reactor) is a
declarative, React-style way to build WinUI 3 apps in **pure C# — no XAML**.
These templates scaffold a runnable, single-project MSIX-packaged Reactor app
whose UI mirrors the matching WinUI 3 XAML templates.

Get the list via `dotnet new list reactor`

| Short Name | Description |
|--------------------|----------------------------------------------------------------------|
| `reactor` | Blank Reactor app (alias `reactor-blank`). Start here if unsure |
| `reactor-mvu` | Reactor app using the Model-View-Update pattern with `UseReducer` |
| `reactor-navview` | Reactor app with a `NavigationView` shell and multiple pages |
| `reactor-tabview` | Reactor app with a `TabView` shell whose tabs live in the title bar |

Each also has a `winui-reactor*` alias (e.g. `winui-reactor`, `winui-reactor-mvu`)
so they show up under `dotnet new list winui` alongside the other WinUI templates.

Reactor apps are packaged (single-project MSIX) and reference the
[`Microsoft.UI.Reactor`](https://www.nuget.org/packages/Microsoft.UI.Reactor)
preview NuGet package. They require .NET 10 or later. Like the WinUI templates,
they reference `Microsoft.Windows.SDK.BuildTools.WinApp` so `dotnet run` launches
the app with full MSIX package identity. Pin a specific Reactor package version
at scaffold time with `--reactor-version`, or the Windows App SDK version with
`--wasdk-version`.

### Item Templates

| Short Name | Description |
Expand Down Expand Up @@ -64,6 +98,22 @@ dotnet run
`dotnet run` registers a loose-layout MSIX, gives the app package identity,
and launches it via AUMID activation — equivalent to F5 in Visual Studio.

### Quickstart a new Reactor app

```powershell
dotnet new reactor -n MyReactorApp
cd MyReactorApp
dotnet run
```

Reactor apps are pure C# (no XAML) and packaged (single-project MSIX), so
`dotnet run` registers a loose-layout package and launches the app with full
MSIX package identity — equivalent to F5 in Visual Studio. See the
[Reactor documentation](https://github.com/microsoft/microsoft-ui-reactor) to
learn the component model, hooks, and layout system. Swap `reactor` for
`reactor-mvu`, `reactor-navview`, or `reactor-tabview` to start from a richer
shell.

### Add items to an existing project

```powershell
Expand Down
68 changes: 43 additions & 25 deletions dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,14 @@ try {
# acquires package identity) via UnitTestClient.Run(), not via
# `dotnet test`. Validate it as an App so we still confirm the
# template builds cleanly.
@{ ShortName = 'winui-unittest'; Kind = 'App' }
@{ ShortName = 'winui-unittest'; Kind = 'App' },
# Reactor (Microsoft.UI.Reactor) app templates: pure C#, unpackaged,
# dotnet-new-only. They build with the same App path below
# (-p:WindowsPackageType=None), and their .csproj already sets it.
@{ ShortName = 'reactor'; Kind = 'App' },
@{ ShortName = 'reactor-mvu'; Kind = 'App' },
@{ ShortName = 'reactor-navview'; Kind = 'App' },
@{ ShortName = 'reactor-tabview'; Kind = 'App' }
)

foreach ($template in $projectTemplates) {
Expand Down Expand Up @@ -711,13 +718,13 @@ try {
Assert-CsprojPackageVersion -CsprojPath $preReleaseCsproj -PackageName 'Microsoft.WindowsAppSDK' -ExpectedVersion '1.8.0-preview1'
Add-Result -Template 'winui' -Platform 'N/A' -Step 'pre-release version content' -Status 'Succeeded' -Path $preReleasePath

# Scenario 5: Invalid version — scaffold succeeds but NuGet restore fails with NU1105
# Scenario 5: Invalid version — scaffold succeeds but NuGet restore fails
Write-Step 'Testing invalid version handling...'
$invalidPath = Join-Path -Path $workingRoot -ChildPath 'VersionInvalid'
Invoke-DotnetCommand -Arguments @('new', 'winui', '-n', 'VersionInvalid', '-o', $invalidPath, '--wasdk-version', 'not-a-version', '--force', '--no-update-check') -WorkingDirectory $workingRoot -Description 'create winui with invalid version'
$invalidCsproj = Join-Path -Path $invalidPath -ChildPath 'VersionInvalid.csproj'
Assert-CsprojPackageVersion -CsprojPath $invalidCsproj -PackageName 'Microsoft.WindowsAppSDK' -ExpectedVersion 'not-a-version'
# Restore should fail with NU1105 because NuGet can't parse an invalid version string
# Restore must fail because NuGet cannot parse an invalid version string
$restoreFailed = $false
$restoreOutput = $null
$restoreText = $null
Expand All @@ -742,24 +749,27 @@ try {
throw "Expected restore to fail for invalid WASDK version 'not-a-version'"
}
$restoreText = $restoreOutput -join "`n"
# Finds NU1105, NETSDK1004, etc.
# Finds NU1105, MSB4181, NETSDK1004, etc.
$errorCodes = @([regex]::Matches($restoreText, '\b(?:NU|NETSDK|MSB)\d{4,}\b') |
ForEach-Object { $_.Value } |
Select-Object -Unique)
if ($errorCodes.Count -gt 0) {
if ($errorCodes -notcontains 'NU1105') {
throw "Expected NU1105, got: $($errorCodes -join ', ')"
}
}
else {
# No machine-readable code surfaced; use narrow fallback
if ($restoreText -notmatch 'not a valid version string') {
throw "Expected invalid version failure, got:`n$restoreText"
}
}
Add-Result -Template 'winui' -Platform 'N/A' -Step 'invalid version: scaffold OK, restore fails with NU1105' -Status 'Succeeded' -Path $invalidPath

# Build (with --no-restore) should fail with NETSDK1005 since restore never succeeded
# The diagnostic NuGet emits for an unparseable version depends on the .NET SDK:
# SDK 8.0.424 / 9.0.317 : no error code; message "'not-a-version' is not a
# valid version string."
# SDK 10.0.400 : MSB4181 — RestoreTask returns false without logging
# the descriptive error, so no NU code surfaces at all.
# Accept any of these shapes. The assertion that matters is that restore fails
# (already enforced above); the code is a secondary signal, so a code appearing
# must not short-circuit the descriptive-message fallback.
$acceptedCodes = @('NU1105', 'MSB4181')
$sawAcceptedCode = @($errorCodes | Where-Object { $acceptedCodes -contains $_ }).Count -gt 0
if (-not $sawAcceptedCode -and $restoreText -notmatch 'not a valid version string') {
throw "Expected an invalid-version restore failure ($($acceptedCodes -join ' / ') or 'not a valid version string'), got codes: $($errorCodes -join ', ')`n$restoreText"
}
Add-Result -Template 'winui' -Platform 'N/A' -Step 'invalid version: scaffold OK, restore fails' -Status 'Succeeded' -Path $invalidPath

# Build (with --no-restore) should fail because restore never produced usable
# assets for this project's target framework.
$buildFailed = $false
$buildOutput = $null
try {
Expand All @@ -781,10 +791,17 @@ try {
throw "Expected build to fail for invalid WASDK version 'not-a-version'"
}
$buildText = $buildOutput -join "`n"
if ($buildText -notmatch 'NETSDK1004') {
throw "Expected NETSDK1004 (assets file missing, please run restore) for invalid WASDK version 'not-a-version', but got:`n$buildText"
}
Add-Result -Template 'winui' -Platform 'N/A' -Step 'invalid version: build fails with NETSDK1004' -Status 'Succeeded' -Path $invalidPath
# Which diagnostic surfaces depends on whether the failed restore left an
# obj/project.assets.json behind:
# NETSDK1004 - no assets file at all (restore wrote nothing).
# NETSDK1005 - assets file exists but has no target for the project's TFM.
# This is what .NET SDK 10 produces: NuGet's RestoreTask fails
# (MSB4181) yet still writes a partial assets file.
# Both mean the same thing here: restore did not produce usable assets.
if ($buildText -notmatch 'NETSDK1004|NETSDK1005') {
throw "Expected NETSDK1004 (assets file missing) or NETSDK1005 (assets file has no target for the TFM) for invalid WASDK version 'not-a-version', but got:`n$buildText"
}
Add-Result -Template 'winui' -Platform 'N/A' -Step 'invalid version: build fails without usable assets' -Status 'Succeeded' -Path $invalidPath

# Scenario 6: Valid version format but nonexistent package
$nonexistentPath = Join-Path -Path $workingRoot -ChildPath 'VersionNonexistent'
Expand Down Expand Up @@ -880,9 +897,10 @@ try {
}
$buildText = $buildOutput -join "`n"
# Expect NU1301 (unable to load source) or NU1102 (package not found) or
# NETSDK1004 (assets file missing because restore never succeeded).
if ($buildText -notmatch 'NU1301|NU1102|NETSDK1004') {
throw "Expected NuGet resolution error (NU1301, NU1102, or NETSDK1004) when sources are unreachable, but got:`n$buildText"
# NETSDK1004/NETSDK1005 (restore never produced usable assets — 1004 when no
# assets file was written, 1005 when a partial one was, as .NET SDK 10 does).
if ($buildText -notmatch 'NU1301|NU1102|NETSDK1004|NETSDK1005') {
throw "Expected NuGet resolution error (NU1301, NU1102, NETSDK1004, or NETSDK1005) when sources are unreachable, but got:`n$buildText"
}
Add-Result -Template 'winui' -Platform 'N/A' -Step 'unreachable source: build fails with NuGet error' -Status 'Succeeded' -Path $unreachablePath

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"dotnetVersion": {
"longName": "dotnet-version",
"shortName": "tfm",
"description": "Base TFM for the project (Microsoft.UI.Reactor requires net10.0 or later)."
},
"reactorVersion": {
"longName": "reactor-version",
"shortName": "rv",
"description": "Pin to a specific Microsoft.UI.Reactor NuGet version."
},
"windowsAppSdkVersion": {
"longName": "wasdk-version",
"shortName": "wasdkv",
"description": "Pin to a specific Windows App SDK NuGet version."
},
"skipRestore": {
"longName": "no-restore",
"shortName": ""
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"icon": "icon.png",
"requiredComponents": [
{
"id": "Microsoft.VisualStudio.Workload.ManagedDesktop",
"hostId": "vs",
"componentType": "setupComponent"
}
],
"symbolInfo": [
{
"id": "dotnetVersion",
"name": {
"text": "Framework"
},
"isVisible": "true"
},
{
"id": "reactorVersion",
"name": {
"text": "Microsoft.UI.Reactor version"
},
"isVisible": "true"
},
{
"id": "windowsAppSdkVersion",
"name": {
"text": "Windows App SDK version"
},
"isVisible": "true"
}
]
}
Loading
Loading