Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file not shown.
30 changes: 23 additions & 7 deletions src/tools/winui-analyzer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Now covers `GetForCurrentView`, `Window.Current`, UWP-XAML namespace false friends,
and the WebView2 containing-type guard.
- **`SuppressionTests.cs`** — pragma-suppression regression test for every shipping rule
(11 tests). A rule that doesn't honor `#pragma warning disable` will turn this red.
- **Corpus regression suite** — [`tools/run-corpus.ps1`](tools/run-corpus.ps1) clones a
curated set of open-source WinUI 3 apps, injects the analyzer, and reports every
diagnostic. Wired to a weekly CI job in `.github/workflows/corpus.yml`.
- **Release pipeline** — `.github/workflows/release.yml` builds, packs, optionally signs
(placeholder), publishes to NuGet on a `v*` tag, and creates a GitHub Release. Manual
dry-run available via workflow_dispatch.
(plus editorconfig-severity suppression coverage for the XAML `WUI2003` diagnostic).
A rule that doesn't honor `#pragma warning disable` will turn this red.
- **`winui-analyze` driver** (`Microsoft.WindowsAppSDK.Analyzers.Driver`) — a standalone,
out-of-build host that runs the analyzers over non-compiling UWP source and emits a
v1.0 JSON migration plan to stdout (`winui-analyze --root <dir> --from-uwp`). Findings
carry machine-readable data (`DetectedApi` / `FeatureArea` / migration tier) on
`Diagnostic.Properties`, so the driver never parses localizable message text.

### Changed
- `UwpApiAnalyzer.GetForCurrentView` heuristic now consults `Allowlists`
instead of inline `Contains("ConnectedAnimationService")` — same behavior, easier to
extend, regression-tested.
- **`WUI0003` now also flags `DependencyObject.Dispatcher` member access** (e.g.
`Dispatcher.HasThreadAccess`, `this.Dispatcher.RunAsync(...)`), not just the literal
`CoreDispatcher` type name. The inherited `Dispatcher` property returns `null` in WinUI 3
desktop apps, so such access compiles clean but throws `NullReferenceException` at launch
(window never appears → run failure) — now surfaced as a **startup-crash** finding.
Detection is symbol-based (a `Dispatcher` property typed `CoreDispatcher`) with a syntactic
fallback (target's rightmost name is exactly `Dispatcher`). The fallback fires **only when the
compilation has no `Windows.UI.Core.CoreDispatcher` metadata** (loose source — the driver's
raw-source path), so real WinUI builds (SDK projections present) resolve symbolically and never
get a false positive. `DispatcherQueue` is unaffected.
- **`WUI2003`** is now categorized `Runtime` (was `Compatibility`) and only fires for controls in
the WinUI/UWP presentation namespace — a custom control named e.g. `Pivot` in a `using:` XAML
namespace is no longer flagged.
- **`winui-analyze` driver** no longer emits a contradictory plan for no-equivalent APIs: a
`WUI1002` finding that also carries a startup-crash tier keeps `severity: startup-crash` but
reports `disposition: defer` with no `fix` (nothing to migrate *to*).

## [0.1.0-alpha] — 2026-04-20

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<!--
Self-contained console driver that hosts the winui-analyzer over still-UWP source
(no restore/build) and emits the migration-plan JSON contract to stdout. Provides the
out-of-build entry point the UWP -> WinUI 3 migration tooling consumes at Step 0
(read from stdout). Published framework-dependent; it embeds Roslyn, so it can't be
AOT-compiled.
-->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Microsoft.WindowsAppSDK.Analyzers.Driver</RootNamespace>
<AssemblyName>winui-analyze</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- App-style CA rules (public-API/localization) don't apply to an internal tool exe. -->
<NoWarn>$(NoWarn);CA1515;CA1303;CA1861;CA2007</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Reference the analyzer as a normal library (instantiate its DiagnosticAnalyzers at
runtime); PrivateAssets=all stops the analyzer from also running on this project. -->
<ProjectReference Include="..\Microsoft.WindowsAppSDK.Analyzers\Microsoft.WindowsAppSDK.Analyzers.csproj"
PrivateAssets="all" ReferenceOutputAssembly="true" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
</ItemGroup>

</Project>
Loading
Loading