diff --git a/docs/README.md b/docs/README.md
index bd37222f2d..6a0d5ba7bb 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -37,6 +37,10 @@ For technical reasoning and implementation details, you can refer to the list of
- [DataSource Attribute Vs ITestDataSource](RFCs/007-DataSource-Attribute-VS-ITestDataSource.md)
- [Test case timeout via runsettings](RFCs/008-TestCase-Timeout.md)
+## Guides
+
+- [Testing WinUI apps](winui-testing.md): packaged (MSIX) vs unpackaged WinUI, and how the test host is started for each.
+
## Design notes
- [MSTest source generator — design](source-generator/design.md): scope, fallback categories, discovery limitations and trim/AOT story for the `MSTest.SourceGeneration` package.
diff --git a/docs/glossary.md b/docs/glossary.md
index 26874f7733..d24cc6690c 100644
--- a/docs/glossary.md
+++ b/docs/glossary.md
@@ -375,7 +375,7 @@ An experimental MTP extension (`Microsoft.Testing.Extensions.Logging`, `[TPEXP]`
### Microsoft.Testing.Extensions.PackagedApp
-An experimental MTP extension (`Microsoft.Testing.Extensions.PackagedApp`, `[Experimental("TPEXP")]`, ships as `1.0.0-alpha`) that enables testing packaged Windows apps (UWP / WinUI) by deploying the test payload to an isolated directory and launching it via the [ITestHostLauncher](#itesthostlauncher) extension point, rather than a plain `Process.Start`. Register via `builder.AddPackagedAppDeployment()`. Full AUMID activation (for apps requiring the app identity manifest) is planned for a follow-up release. Introduced in [PR #9454](https://github.com/microsoft/testfx/pull/9454). See also [ITestHostLauncher](#itesthostlauncher).
+An experimental MTP extension (`Microsoft.Testing.Extensions.PackagedApp`, `[Experimental("TPEXP")]`, ships as `1.0.0-alpha`) that enables testing packaged Windows apps (full-trust MSIX desktop, e.g. packaged WinUI) by registering the layout with the `PackageManager` and activating it by AUMID through the [ITestHostLauncher](#itesthostlauncher) extension point, rather than a plain `Process.Start`. Register via `builder.AddPackagedAppDeployment()`, or simply by referencing the package (its MSBuild props register the hook). The launcher only enables itself when the test application is a packaged layout — a manifest in the app's own directory, or an ancestor `AppxManifest.xml` whose `Application/@Executable` resolves back to the app directory — so referencing it from an **unpackaged** app does not force the test host controller process model or copy the build output; `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` (`auto`/`always`/`never`) overrides that decision. Introduced in [PR #9454](https://github.com/microsoft/testfx/pull/9454); AUMID activation added in [PR #9970](https://github.com/microsoft/testfx/pull/9970). See also [ITestHostLauncher](#itesthostlauncher) and [docs/winui-testing.md](winui-testing.md).
## N
diff --git a/docs/winui-testing.md b/docs/winui-testing.md
new file mode 100644
index 0000000000..47614e94ff
--- /dev/null
+++ b/docs/winui-testing.md
@@ -0,0 +1,176 @@
+# Testing WinUI apps with MSTest and Microsoft.Testing.Platform
+
+WinUI 3 test apps come in two flavors, and which one you use decides how the test host is started:
+
+| Flavor | `WindowsPackageType` | Has an `AppxManifest.xml` in the build output | How the test host starts |
+| --- | --- | --- | --- |
+| **Packaged** (MSIX) | unset (the default) | yes | The app must be registered with the OS and activated by Application User Model ID (AUMID). `Process.Start` cannot start it. |
+| **Unpackaged** | `None` | no | It is an ordinary Windows executable. `Process.Start` is all that is needed. |
+
+Both flavors are supported when you run on [Microsoft.Testing.Platform](https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-intro) (MTP), which you enable with `true`. Under MTP the WinUI app **is** the test host: it hosts the platform in-process, so VSTest's appx runtime provider is never involved. A packaged app still needs the [`Microsoft.Testing.Extensions.PackagedApp`](#packaged-msix-winui) launcher to register and AUMID-activate that host, because a packaged app cannot be started with `Process.Start`; an unpackaged app needs nothing extra.
+
+> [!NOTE]
+> Unpackaged WinUI is not supported under VSTest. VSTest routes every `UseWinUI` project through its `UwpTestHostRuntimeProvider`, which unconditionally reads an `AppxManifest.xml` from the build output and fails with `FileNotFoundException` when there is none. That provider ships in Visual Studio, not in this repository. See [#2784](https://github.com/microsoft/testfx/issues/2784).
+
+## Unpackaged WinUI
+
+Set `WindowsPackageType` to `None` and enable the MSTest runner:
+
+```xml
+
+
+
+ Exe
+ net9.0-windows10.0.19041.0
+ 10.0.17763.0
+ true
+
+
+ None
+
+ true
+
+
+
+
+
+
+
+
+```
+
+Point `[UITestMethod]` at a dispatcher queue so UI tests run on the UI thread. Which mechanism you use depends on whether the test app is itself the WinUI app:
+
+**Self-hosted (the app is the test host).** A WinUI app already generates its own entry point from its `ApplicationDefinition`, so tell the platform not to generate a competing one, and host the platform yourself from `OnLaunched`:
+
+```xml
+
+ true
+
+ false
+
+```
+
+The process has already called `Application.Start`, so publish that dispatcher directly rather than letting the attribute start another application:
+
+```csharp
+protected override async void OnLaunched(LaunchActivatedEventArgs args)
+{
+ _window = new UnitTestAppWindow();
+ _window.Activate();
+ UITestMethodAttribute.DispatcherQueue = _window.DispatcherQueue;
+
+ string[] cliArgs = Environment.GetCommandLineArgs().Skip(1).ToArray();
+ ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(cliArgs);
+ builder.AddSelfRegisteredExtensions(cliArgs);
+ using ITestApplication app = await builder.BuildAsync();
+
+ // The WinUI-generated entry point is 'void', so publish the exit code yourself.
+ Environment.ExitCode = await app.RunAsync();
+ _window.Close();
+ Exit();
+}
+```
+
+> [!IMPORTANT]
+> Do **not** use `[assembly: WinUITestTarget(...)]` in a self-hosted app. That attribute makes `UITestMethodAttribute` start an application itself, which would be a second `Application.Start` in the same process and fails.
+
+**Separate host.** When the test host is an ordinary executable and no `Application` has been started yet, let the attribute start one:
+
+```csharp
+[assembly: WinUITestTarget(typeof(MyApp.App))]
+```
+
+With either setup, `dotnet run` (or `dotnet test`) starts the executable directly and the run finishes in a single process.
+
+### Building unpackaged WinUI projects
+
+Build with `dotnet build` as usual. Note that older Windows App SDK releases required the MrtCore PRI generation
+MSBuild tasks that ship with Visual Studio (`Microsoft.Build.Packaging.Pri.Tasks.dll`); on those versions a
+`dotnet` CLI build fails with:
+
+```text
+error MSB4062: The "Microsoft.Build.Packaging.Pri.Tasks.ExpandPriContent" task could not be loaded
+```
+
+If you hit that, either build from Visual Studio (or with its `MSBuild.exe`) or move to a newer
+`Microsoft.WindowsAppSDK`. This is a Windows App SDK build requirement, not an MSTest one.
+
+## Packaged (MSIX) WinUI
+
+A packaged app keeps the default `WindowsPackageType` and ships a `Package.appxmanifest`. Because it cannot be started with `Process.Start`, the test host has to be registered and activated by AUMID. Add the [`Microsoft.Testing.Extensions.PackagedApp`](https://www.nuget.org/packages/Microsoft.Testing.Extensions.PackagedApp) package, which does exactly that through the platform's `ITestHostLauncher` extension point:
+
+```xml
+
+```
+
+Referencing the package is enough — its MSBuild props register the launcher. Do **not** also call `builder.AddPackagedAppDeployment()` when you already use `AddSelfRegisteredExtensions`, because at most one test host launcher may be registered per run.
+
+Requirements and limitations:
+
+- Target a Windows TFM at platform version `10.0.19041.0` or higher (for example `net8.0-windows10.0.19041.0`) so NuGet resolves the Windows asset that contains the register-and-activate path. The plain `net8.0`/`net9.0` asset fails fast with an actionable message instead.
+- Registering an unsigned build-output layout requires **Developer Mode** (or sideloading) to be enabled on the machine.
+- Only **full-trust packaged desktop** hosts are supported. True UWP/AppContainer hosts are not: activation arguments are not delivered as `argv` there, and the controller pipe is not granted the package SID.
+
+See [#9933](https://github.com/microsoft/testfx/issues/9933) for the implementation of this path.
+
+## When does the PackagedApp launcher take over?
+
+Registering an *enabled* test host launcher switches the whole run to the test host controller (process restart) model, because a custom launcher only has an effect when an out-of-process test host is started. That is the right trade for a packaged app, but it is pure overhead for an app that just needs `Process.Start`.
+
+The launcher therefore decides for itself, per run:
+
+| Situation | Launcher enabled? | Effect |
+| --- | --- | --- |
+| Not Windows | no | Nothing changes. Packaged Windows apps are a Windows-only concept. |
+| Packaged layout (an `AppxManifest.xml` that describes this app — see below) | yes | The layout is registered and activated by AUMID. |
+| Any other layout — including unpackaged WinUI and ordinary console test apps | no | The platform keeps its default in-process / `Process.Start` path. |
+
+So an **unpackaged** WinUI app that references `Microsoft.Testing.Extensions.PackagedApp` (directly, or transitively through a shared `Directory.Packages.props`) pays nothing for it: no extra process, and no copy of the build output into a deployment directory.
+
+### How a manifest is attributed to your app
+
+"Packaged layout" means a manifest that actually describes *this* app, not merely any `AppxManifest.xml` somewhere above it:
+
+- An `AppxManifest.xml` **in the app's own directory** is taken as the app's layout.
+- An `AppxManifest.xml` in an **ancestor** directory is used only when one of its `` entries declares an `Executable` that resolves back to the app directory — and, when the launcher is actually starting the host, to that exact executable. This is what lets `Application/@Executable` point into a subdirectory of the package root at any depth.
+- An ancestor manifest that declares no matching `Executable` is ignored, so a stray manifest in a shared build root or CI staging directory cannot classify an unrelated test app as packaged.
+
+### Overriding the decision
+
+Set the `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` environment variable to override the layout probe. Values are compared case-insensitively; anything unrecognized falls back to `auto` rather than failing the run.
+
+| Value | Behavior |
+| --- | --- |
+| unset, or `auto` | Enable only for a packaged layout. This is the default described above. |
+| `always` | Always enable. Use this to deploy a **non-packaged** layout into an isolated directory and launch the produced executable from there, for tests that must not run from the build output. |
+| `never` | Never enable, even for a packaged layout. Escape hatch if the automatic detection gets in your way. |
+
+## Behavior notes
+
+- **The app must be able to exit.** `Application.Start` pumps a message loop that never returns, so `UITestMethodAttribute` runs it on a background thread. Otherwise the process would stay alive after the run and hang when the test app is itself the test host — which is exactly the unpackaged MTP case. See [#9904](https://github.com/microsoft/testfx/pull/9904).
+- **Publish the exit code yourself.** The WinUI-generated entry point is `void`, so a self-hosted test app must assign `Environment.ExitCode = await app.RunAsync();` and then call `Exit()`. Without it the process always exits `0` and failing tests never fail the build.
+- **MrtCore warns about MSTest's satellite assemblies.** A WinUI build indexes resources with MrtCore, which reports `PRI257`/`PRI263` because MSTest ships localized satellite assemblies that carry no `en-US` default. It is benign — the warning is about resource *lookup* fallback, not about your tests. Note it cannot be silenced with `NoWarn` or `MSBuildWarningsAsMessages`, because MrtCore puts the `PRI…` code in the message text rather than in the MSBuild warning code; if you build with warnings as errors, exclude this project from that setting.
+- **Avoid `dotnet exec`.** WinUI resolves its PRI resources relative to the *process* path, so running the test app under `dotnet.exe` breaks resource loading. `Microsoft.Testing.Platform.MSBuild` already prefers launching the apphost directly when one is available.
+- **Startup failures surface as test failures.** If the application cannot be brought up on the `WinUITestTarget` path — a throwing `Application` constructor, or in an unpackaged app a Windows App SDK runtime that cannot be resolved (`COMException` / `REGDB_E_CLASSNOTREG`) — the failure is now reported on the test. Earlier versions swallowed it and the run hung with no diagnostic at all.
+
+## How the Windows App SDK gets initialized
+
+An unpackaged app has no MSIX manifest declaring a framework dependency, so the Windows App SDK runtime has to be resolved at startup by the *bootstrapper*. You normally write no code for this: when
+
+- `WindowsPackageType` is `None`,
+- `WindowsAppSDKSelfContained` is not `true`, and
+- `OutputType` is `Exe` or `WinExe`,
+
+the Windows App SDK build injects a [module initializer](https://learn.microsoft.com/dotnet/csharp/language-reference/proposals/csharp-9.0/module-initializers) into **your app assembly** that calls `Bootstrap.Initialize`. The CLR runs a module initializer before the first use of any type in that assembly, so it has already run by the time your tests execute.
+
+That is why a plain `[TestMethod]` — not just `[UITestMethod]` — can call Windows App SDK WinRT APIs in an unpackaged test app.
+
+Note those conditions are evaluated per project, and a **class library** does not get the initializer. If your tests live in a library loaded by a host that is not itself a Windows App SDK app, set `true` explicitly.
+
+## Related
+
+- [`Microsoft.Testing.Extensions.PackagedApp` package readme](../src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md)
+- [RFC 017 — Test host launcher](RFCs/017-TestHost-Launcher.md)
+- [`MSTestRunnerWinUI` sample](../samples/public/mstest-runner/MSTestRunnerWinUI) (packaged, MTP)
+- [`MSTestRunnerWinUIUnpackaged` sample](../samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged) (unpackaged, MTP)
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/MSTestRunnerWinUI.csproj b/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/MSTestRunnerWinUI.csproj
index a578462ebb..e8ad3795c0 100644
--- a/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/MSTestRunnerWinUI.csproj
+++ b/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/MSTestRunnerWinUI.csproj
@@ -54,10 +54,12 @@
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/UnitTestApp.xaml.cs b/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/UnitTestApp.xaml.cs
index 7925dab0d3..e554984855 100644
--- a/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/UnitTestApp.xaml.cs
+++ b/samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/UnitTestApp.xaml.cs
@@ -63,16 +63,21 @@ void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(cliArgs);
// Registers all MSBuild-contributed extensions, including the Microsoft.Testing.Extensions.PackagedApp
- // launcher (from the PackageReference in the csproj). That launcher deploys this packaged WinUI test
- // host into an isolated directory and launches it from there through the platform's ITestHostLauncher
- // extension point.
+ // launcher (from the PackageReference in the csproj). Because this app is packaged (MSIX), that
+ // launcher registers the layout with the OS and activates it by Application User Model ID through
+ // the platform's ITestHostLauncher extension point, instead of a plain Process.Start.
builder.AddSelfRegisteredExtensions(cliArgs);
using ITestApplication app = await builder.BuildAsync();
- await app.RunAsync();
+
+ // The WinUI-generated entry point is 'void', so the run's exit code has to be published through
+ // Environment.ExitCode. Without this the app would always exit 0 and failing tests would never
+ // fail the build.
+ Environment.ExitCode = await app.RunAsync();
}
finally
{
_window.Close();
+ Exit();
}
#else
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine);
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.slnx b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.slnx
new file mode 100644
index 0000000000..897a30e191
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.slnx
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.csproj b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.csproj
new file mode 100644
index 0000000000..173b6134dc
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged.csproj
@@ -0,0 +1,61 @@
+
+
+ Exe
+ net8.0-windows10.0.19041.0
+ 10.0.17763.0
+ MSTestRunnerWinUIUnpackaged
+ app.manifest
+ x86;x64;ARM64
+ win-x86;win-x64;win-arm64
+ true
+ enable
+
+
+ None
+
+
+ false
+
+
+
+ true
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+ False
+
+
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/Properties/launchSettings.json b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/Properties/launchSettings.json
new file mode 100644
index 0000000000..e678aecf94
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/Properties/launchSettings.json
@@ -0,0 +1,7 @@
+{
+ "profiles": {
+ "MSTestRunnerWinUIUnpackaged (Unpackaged)": {
+ "commandName": "Project"
+ }
+ }
+}
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml
new file mode 100644
index 0000000000..e72238f10e
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml.cs b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml.cs
new file mode 100644
index 0000000000..36252009ba
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestApp.xaml.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+
+using Microsoft.Testing.Platform.Builder;
+using Microsoft.UI.Xaml;
+using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
+
+namespace MSTestRunnerWinUIUnpackaged;
+
+///
+/// Provides application-specific behavior to supplement the default Application class.
+///
+public partial class UnitTestApp : Application
+{
+ private Window? _window;
+
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public UnitTestApp() => InitializeComponent();
+
+ ///
+ /// Invoked when the application is launched.
+ ///
+ /// Details about the launch request and process.
+ protected override async void OnLaunched(LaunchActivatedEventArgs args)
+ {
+ _window = new UnitTestAppWindow();
+ _window.Activate();
+
+ // Tests marked [UITestMethod] run on this window's dispatcher queue. This process has already
+ // called Application.Start, so the dispatcher has to be published here. Do NOT use
+ // [assembly: WinUITestTarget(...)] in a self-hosted app like this one: it would make
+ // UITestMethodAttribute start a second application in the same process.
+ UITestMethodAttribute.DispatcherQueue = _window.DispatcherQueue;
+
+ try
+ {
+ // Ideally we would want to reuse the generated main so we don't have to manually handle all
+ // dependencies, but this type is generated too late in the build process so we fail before.
+ // You can build, inspect the generated type to copy its content if you want.
+ string[] cliArgs = Environment.GetCommandLineArgs()
+ .Skip(1)
+ .Where(arg => !arg.Contains("EnableMSTestRunner"))
+ .ToArray();
+ ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(cliArgs);
+ builder.AddSelfRegisteredExtensions(cliArgs);
+ using ITestApplication app = await builder.BuildAsync();
+
+ // The WinUI-generated entry point is 'void', so the run's exit code has to be published
+ // through Environment.ExitCode. Without this the app would always exit 0 and failing tests
+ // would never fail the build.
+ Environment.ExitCode = await app.RunAsync();
+ }
+ finally
+ {
+ // Closing the window lets the message loop drain so the process can exit once the run is
+ // done. Without this an unpackaged test app — which is itself the test host — would hang
+ // after reporting results.
+ _window.Close();
+ Exit();
+ }
+ }
+}
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml
new file mode 100644
index 0000000000..6bf8b5fc40
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml.cs b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml.cs
new file mode 100644
index 0000000000..01f33bfabb
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTestAppWindow.xaml.cs
@@ -0,0 +1,11 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Microsoft.UI.Xaml;
+
+namespace MSTestRunnerWinUIUnpackaged;
+
+public sealed partial class UnitTestAppWindow : Window
+{
+ public UnitTestAppWindow() => InitializeComponent();
+}
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTests.cs b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTests.cs
new file mode 100644
index 0000000000..35eb9e0b2a
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/UnitTests.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
+
+namespace MSTestRunnerWinUIUnpackaged;
+
+[TestClass]
+public partial class UnitTest1
+{
+ ///
+ /// Asserts the property that defines this sample: the app runs with no MSIX package identity.
+ /// Package.Current is only available to a packaged app and throws otherwise.
+ ///
+ [TestMethod]
+ public void AppRunsWithoutPackageIdentity()
+ => Assert.ThrowsExactly(() => _ = Windows.ApplicationModel.Package.Current);
+
+ ///
+ /// A plain [TestMethod] that touches a Windows App SDK WinRT type. In an unpackaged app this only
+ /// resolves once the Windows App SDK bootstrapper has run, which the Windows App SDK arranges
+ /// through a module initializer it injects into this assembly. It is covered here because it is the
+ /// case that does NOT go through [UITestMethod].
+ ///
+ [TestMethod]
+ public void WindowsAppSdkWinRTIsUsableFromAPlainTestMethod()
+ {
+ var releaseInfo = Microsoft.Windows.ApplicationModel.WindowsAppRuntime.RuntimeInfo.AsString;
+
+ // A parseable version proves the bootstrapper resolved a real runtime, rather than the call
+ // merely returning some non-empty string.
+ Assert.IsNotNull(releaseInfo);
+ Assert.IsTrue(Version.TryParse(releaseInfo, out _), $"Expected a Windows App Runtime version, got '{releaseInfo}'.");
+ }
+
+ ///
+ /// Use [UITestMethod] for tests that need the UI thread. WinUI controls can only be created there,
+ /// so constructing one would fail with RPC_E_WRONG_THREAD from a plain [TestMethod]. The control
+ /// reports the dispatcher of the thread that created it, and that dispatcher confirms the test body
+ /// is itself running on that thread.
+ ///
+ [UITestMethod]
+ public void UITestMethodCreatesWinUIControlsOnTheUIThread()
+ {
+ var grid = new Grid();
+
+ Assert.IsNotNull(grid.DispatcherQueue);
+ Assert.IsTrue(grid.DispatcherQueue.HasThreadAccess, "The Grid was not created on the UI thread.");
+ }
+}
diff --git a/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/app.manifest b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/app.manifest
new file mode 100644
index 0000000000..f07fcbb1f1
--- /dev/null
+++ b/samples/public/mstest-runner/MSTestRunnerWinUIUnpackaged/MSTestRunnerWinUIUnpackaged/app.manifest
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PerMonitorV2
+
+
+
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs
index 30ad3d37e1..6beba7cb18 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs
@@ -74,33 +74,127 @@ private AppxManifestInfo(string packageName, string publisher, IReadOnlyList
- /// Searches and each of its ancestors for an
- /// AppxManifest.xml and returns the path to the nearest one. A packaged app's manifest
- /// lives at the package layout root, but an Application/@Executable can point into a
- /// subdirectory (for example bin\host.exe), so the executable's own directory is not
- /// necessarily the root. Walking up locates the manifest in that valid layout too, so the launcher
- /// does not miss a packaged layout and fall through to Process.Start. Like
- /// this is a cheap existence probe that never parses.
+ /// Searches and its ancestors for an AppxManifest.xml
+ /// that plausibly describes the app under . A packaged app's
+ /// manifest lives at the package layout root, but an Application/@Executable can point into
+ /// an arbitrarily deep subdirectory (for example bin\host.exe), so the executable's own
+ /// directory is not necessarily the root. The manifest in is
+ /// accepted as the app's own layout without parsing; ancestor manifests are parsed and accepted only
+ /// when an application executable resolves back to . Malformed or
+ /// unreadable ancestor manifests are ignored.
///
/// The directory to start searching from (typically the executable's directory).
///
- /// The full path to the nearest AppxManifest.xml at or above ;
- /// otherwise .
+ /// The full path to the nearest AppxManifest.xml at or above
+ /// that matches the app directory; otherwise .
///
public static string? FindManifestPath(string startDirectory)
+ => FindManifestPathCore(startDirectory, executablePath: null);
+
+ ///
+ /// Searches and its ancestors for an AppxManifest.xml
+ /// that plausibly describes . The manifest in
+ /// is accepted as the app's own layout without parsing; an
+ /// ancestor manifest is parsed and accepted only when one of its applications declares exactly
+ /// . Matching the whole path (rather than just the directory, as
+ /// the enablement overload must) keeps a package that declares a different application alongside it
+ /// from being activated under the wrong Application User Model ID. Malformed or unreadable ancestor
+ /// manifests are ignored.
+ ///
+ /// The directory to start searching from (typically the executable's directory).
+ /// The executable that the manifest must describe when found in an ancestor directory.
+ ///
+ /// The full path to the nearest matching AppxManifest.xml at or above
+ /// ; otherwise .
+ ///
+ public static string? FindManifestPath(string startDirectory, string executablePath)
+ => FindManifestPathCore(startDirectory, executablePath);
+
+ private static string? FindManifestPathCore(string startDirectory, string? executablePath)
{
- for (DirectoryInfo? directory = new(startDirectory); directory is not null; directory = directory.Parent)
+ // The trailing separator matters: the launcher passes AppContext.BaseDirectory, which ends with
+ // one, while Path.GetDirectoryName never returns one. Comparing the two unnormalized would never
+ // match, so a valid ancestor manifest would never be attributed during enablement.
+ string fullStartDirectory = NormalizeDirectory(startDirectory);
+ string? fullExecutablePath = executablePath is null ? null : Path.GetFullPath(executablePath);
+ DirectoryInfo? directory = new(startDirectory);
+ bool isStartDirectory = true;
+ while (directory is not null)
{
string? manifestPath = GetManifestPath(directory.FullName);
- if (manifestPath is not null)
+ if (manifestPath is not null
+ && (isStartDirectory || IsAncestorManifestForApp(manifestPath, directory.FullName, fullStartDirectory, fullExecutablePath)))
{
return manifestPath;
}
+
+ directory = directory.Parent;
+ isStartDirectory = false;
}
return null;
}
+ private static bool IsAncestorManifestForApp(string manifestPath, string manifestDirectory, string appDirectory, string? executablePath)
+ {
+ AppxManifestInfo manifestInfo;
+ try
+ {
+ manifestInfo = ReadFromManifest(manifestPath);
+ }
+ catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidOperationException or System.Xml.XmlException)
+ {
+ return false;
+ }
+
+ foreach (AppxApplicationInfo application in manifestInfo.Applications)
+ {
+ if (application.Executable is null)
+ {
+ continue;
+ }
+
+ string? applicationExecutablePath = ResolvePackageRelativePath(manifestDirectory, application.Executable);
+ if (applicationExecutablePath is null)
+ {
+ continue;
+ }
+
+ if (executablePath is not null)
+ {
+ // The launch path knows exactly which executable it was asked to start, so it must match
+ // that entry. Accepting any executable that merely sits in the same directory would let a
+ // package that declares a different application there be activated under the wrong
+ // Application User Model ID.
+ if (string.Equals(applicationExecutablePath, executablePath, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+
+ continue;
+ }
+
+ // Enablement only knows the app directory (there is no launch context yet), so attribute the
+ // manifest when it places an application there.
+ string? applicationDirectory = Path.GetDirectoryName(applicationExecutablePath);
+ if (applicationDirectory is not null
+ && string.Equals(NormalizeDirectory(applicationDirectory), appDirectory, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Returns as a full path without a trailing directory separator, so
+ /// that directories obtained from different APIs compare equal. AppContext.BaseDirectory ends
+ /// with a separator while never does.
+ ///
+ private static string NormalizeDirectory(string directory)
+ => Path.TrimEndingDirectorySeparator(Path.GetFullPath(directory));
+
/// Reads and parses the manifest at .
/// The path to an AppxManifest.xml.
/// The parsed manifest info.
@@ -152,6 +246,65 @@ public static AppxManifestInfo ReadFromManifest(Stream manifestStream)
return new AppxManifestInfo(name, publisher, applications);
}
+ ///
+ /// Resolves the application whose test host the platform asked to launch, preferring the one whose
+ /// declared executable resolves exactly to . A package may declare
+ /// several applications whose executables share a file name in different subdirectories, and the
+ /// file name alone cannot tell those apart; the full path can. Falls back to file-name matching
+ /// (see ) when no application declares this exact path,
+ /// which is the usual case for a manifest that omits Application/@Executable.
+ ///
+ /// The directory holding the manifest, used to resolve package-relative executables.
+ /// The full path of the executable the platform asked to launch.
+ ///
+ /// The matching application, or when the manifest declares no application.
+ ///
+ ///
+ /// The manifest declares application executables but none of them is
+ /// (so it describes a different application), or several
+ /// applications declare that same executable (so it cannot identify one of them).
+ ///
+ public AppxApplicationInfo? ResolveApplication(string manifestDirectory, string executablePath)
+ {
+ string fullExecutablePath = Path.GetFullPath(executablePath);
+ AppxApplicationInfo[] exactMatches = [.. Applications.Where(application =>
+ application.Executable is not null
+ && string.Equals(ResolvePackageRelativePath(manifestDirectory, application.Executable), fullExecutablePath, StringComparison.OrdinalIgnoreCase))];
+
+ if (exactMatches.Length == 1)
+ {
+ return exactMatches[0];
+ }
+
+ if (exactMatches.Length > 1)
+ {
+ // Several applications declare this very executable, so it cannot identify one of them. That
+ // is an ambiguity, not a mismatch: name the candidate Application User Model IDs rather than
+ // claiming nothing matched.
+ throw new InvalidOperationException(
+ string.Format(
+ CultureInfo.CurrentCulture,
+ ExtensionResources.AmbiguousAppxManifestApplication,
+ executablePath,
+ string.Join(", ", exactMatches.Select(static application => application.AppUserModelId))));
+ }
+
+ // The manifest names executables, but not the one we were asked to launch: it describes a
+ // different application, and activating that would use the wrong Application User Model ID. Only
+ // fall back to file-name resolution when nothing declares an executable, which is the case that
+ // cannot be validated at all (a minimal manifest that omits Application/@Executable).
+ AppxApplicationInfo[] declaringApplications = [.. Applications.Where(static application => application.Executable is not null)];
+
+ return declaringApplications.Length == 0
+ ? ResolveApplication(Path.GetFileName(executablePath))
+ : throw new InvalidOperationException(
+ string.Format(
+ CultureInfo.CurrentCulture,
+ ExtensionResources.AppxManifestApplicationExecutableMismatch,
+ executablePath,
+ string.Join(", ", declaringApplications.Select(static application => application.Executable))));
+ }
+
///
/// Resolves the application whose test host the platform asked to launch. Most packages declare a
/// single application, which is returned directly. When a package declares several, the entry is
@@ -204,6 +357,28 @@ private static string GetExecutableFileName(string executable)
return lastSeparator < 0 ? executable : executable[(lastSeparator + 1)..];
}
+ private static string? ResolvePackageRelativePath(string manifestDirectory, string packageRelativePath)
+ {
+ if (packageRelativePath.Length == 0
+ || packageRelativePath[0] is '\\' or '/'
+ || packageRelativePath.Contains(':', StringComparison.Ordinal))
+ {
+ return null;
+ }
+
+ string fullManifestDirectory = Path.GetFullPath(manifestDirectory);
+ string[] pathSegments = packageRelativePath.Split(['\\', '/'], StringSplitOptions.RemoveEmptyEntries);
+ string resolvedPath = Path.GetFullPath(Path.Combine([fullManifestDirectory, .. pathSegments]));
+ string relativePath = Path.GetRelativePath(fullManifestDirectory, resolvedPath);
+
+ return relativePath == ".."
+ || relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)
+ || relativePath.StartsWith($"..{Path.AltDirectorySeparatorChar}", StringComparison.Ordinal)
+ || Path.IsPathRooted(relativePath)
+ ? null
+ : resolvedPath;
+ }
+
///
/// Computes the 13-character publisher id (the suffix of the package family name) for
/// , using the public Windows algorithm: base32-encode the first 8
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt
index ca7986868c..c1dce813e9 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt
@@ -12,9 +12,11 @@ Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageFamilyName.get
Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageName.get -> string!
Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Publisher.get -> string!
Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ResolveApplication(string? executableFileName) -> Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo?
+Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ResolveApplication(string! manifestDirectory, string! executablePath) -> Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo?
const Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.AppxManifestFileName = "AppxManifest.xml" -> string!
static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ComputePublisherId(string! publisher) -> string!
static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.FindManifestPath(string! startDirectory) -> string?
+static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.FindManifestPath(string! startDirectory, string! executablePath) -> string?
static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.GetManifestPath(string! layoutDirectory) -> string?
static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ReadFromManifest(System.IO.Stream! manifestStream) -> Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo!
static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ReadFromManifest(string! manifestPath) -> Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo!
@@ -28,3 +30,5 @@ static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.
static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.TryGetTestHostControllerPid(System.Collections.Generic.IReadOnlyList! arguments) -> string?
static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackHandshake.Write(string! filePath, System.Collections.Generic.IEnumerable>! entries) -> void
static Microsoft.Testing.Extensions.PackagedApp.PackagedAppConnectBackReader.TryApplyConnectBackEnvironment(System.Collections.Generic.IReadOnlyList! commandLineArguments) -> void
+Microsoft.Testing.Extensions.PackagedApp.PackagedAppTestHostLauncher.PackagedAppTestHostLauncher(string! testApplicationDirectory, System.Func! getEnvironmentVariable) -> void
+const Microsoft.Testing.Extensions.PackagedApp.PackagedAppTestHostLauncher.LauncherModeEnvironmentVariable = "TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER" -> string!
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj
index 42c738368c..ac0837c3cc 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Microsoft.Testing.Extensions.PackagedApp.csproj
@@ -33,7 +33,7 @@
+This package extends Microsoft Testing Platform to start Windows test hosts that cannot simply be Process.Started. In its Windows build (net*-windows) it registers a packaged, full-trust MSIX desktop app layout with the PackageManager and activates it by Application User Model ID (see https://github.com/microsoft/testfx/issues/9933); a non-packaged (loose-layout) Windows test host can optionally be deployed to an isolated directory and launched from there. The launcher enables itself only for a packaged layout, so referencing it from an unpackaged app (for example unpackaged WinUI) does not change how that app runs. True UWP/AppContainer hosts are not supported.]]>
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md
index 7c55cacfb7..a652d3d3fd 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md
@@ -3,12 +3,28 @@
> [!IMPORTANT]
> This package is experimental and consumes the experimental `ITestHostLauncher` extension point of [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform). The API may change or be removed in a future update.
-`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that deploys and launches Windows test hosts: a non-packaged (loose-layout) host (for example, unpackaged WinUI) is deployed into an isolated directory and launched from there, and — in its Windows build (`net*-windows`) — a packaged, full-trust MSIX desktop host is registered with the OS and activated by Application User Model ID (AUMID).
+`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that starts Windows test hosts which cannot simply be `Process.Start`ed. In its Windows build (`net*-windows`) a packaged, full-trust MSIX desktop host is registered with the OS and activated by Application User Model ID (AUMID); a non-packaged (loose-layout) host can optionally be deployed into an isolated directory and launched from there.
It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. Packaged Windows apps require package identity and ship as MSIX; VSTest exposes a single `UwpTestHostRuntimeProvider` for the equivalent scenario, built on Visual-Studio-internal deployment components, whereas this extension uses only public, redistributable Windows APIs:
-- **Deploy + launch loose layout**: a non-packaged (loose-layout) app — one without an `AppxManifest.xml`, such as unpackaged WinUI — is deployed to a deployment directory and the produced executable is launched from there.
- **Packaged AUMID activation** (Windows build): a packaged (MSIX) layout is registered in place with the `PackageManager` and the app is activated by AUMID via `IApplicationActivationManager` — the scenario tracked by [#9933](https://github.com/microsoft/testfx/issues/9933). This connect-back transport targets **full-trust packaged (MSIX) desktop hosts**; true UWP/AppContainer hosts are not supported, and registering an unsigned build-output layout requires Developer Mode (or sideloading). The plain `net8.0`/`net9.0` build rejects a packaged layout with an actionable error pointing at the Windows TFM.
+- **Deploy + launch loose layout** (opt-in): a non-packaged app — one without an `AppxManifest.xml` — is deployed to a deployment directory and the produced executable is launched from there.
+
+## When the launcher takes over
+
+Registering an *enabled* test host launcher switches the run to the test host controller (process restart) model, because a launcher only has an effect when an out-of-process test host is started. To avoid charging that cost to apps that do not need it, the launcher enables itself only when it has real work to do:
+
+| Situation | Enabled? |
+| --- | --- |
+| Not Windows | no |
+| Packaged layout (an `AppxManifest.xml` that describes this app) | yes |
+| Any other layout, including **unpackaged WinUI** and ordinary console test apps | no |
+
+A manifest in the app's own directory is taken as the app's layout. A manifest in an ancestor directory is used only when one of its `` entries declares an `Executable` resolving back to the app directory (and, at launch, to that exact executable), which supports `Application/@Executable` pointing into a package subdirectory at any depth while keeping a stray manifest in a shared build root from classifying an unrelated app as packaged.
+
+So referencing this package from an unpackaged app costs nothing: no extra process, and no copy of the build output.
+
+Set `TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER` to override that decision — `always` opts a non-packaged layout into deploy-and-launch, `never` keeps the launcher out of the way entirely, and `auto` (the default) probes the layout.
Microsoft.Testing.Platform is open source. You can find `Microsoft.Testing.Extensions.PackagedApp` code in the [microsoft/testfx](https://github.com/microsoft/testfx) GitHub repository.
@@ -22,7 +38,7 @@ dotnet add package Microsoft.Testing.Extensions.PackagedApp
This package extends Microsoft.Testing.Platform with:
-- **Deployment + launch**: stages a non-packaged (loose-layout) Windows test host payload (for example, unpackaged WinUI) into an isolated directory and launches the deployed copy; the Windows build additionally registers and activates a packaged, full-trust MSIX desktop host by AUMID (see [#9933](https://github.com/microsoft/testfx/issues/9933)).
+- **Registration + activation**: registers a packaged, full-trust MSIX desktop test host and activates it by AUMID (see [#9933](https://github.com/microsoft/testfx/issues/9933)); optionally stages a non-packaged (loose-layout) Windows test host payload into an isolated directory and launches the deployed copy.
- **Mechanism-agnostic monitoring**: returns an `ITestHostHandle` that exposes only the lifecycle the platform needs (surfacing the activated process id for the packaged path, and none for the deployed loose-layout path).
## Documentation
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs
index b253e9b677..17f9ce889a 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs
@@ -7,21 +7,26 @@
namespace Microsoft.Testing.Extensions;
///
-/// Provides extension methods for adding Windows test host deployment support (non-packaged
-/// loose layouts such as unpackaged WinUI, and packaged, full-trust MSIX desktop apps) to the test
-/// application builder.
+/// Provides extension methods for adding Windows test host launch support (packaged, full-trust MSIX
+/// desktop apps, and — when opted in — non-packaged loose layouts) to the test application builder.
///
[Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")]
public static class PackagedAppExtensions
{
///
- /// Registers a test host launcher for Windows test applications. Non-packaged (loose-layout) hosts
- /// (for example, unpackaged WinUI) are deployed into an isolated directory and launched from there.
- /// Packaged, full-trust MSIX desktop hosts are registered with the OS and activated by Application
- /// User Model ID in the Windows build of this extension (see
- /// https://github.com/microsoft/testfx/issues/9933); the plain build rejects a packaged layout with
- /// an actionable error. True UWP/AppContainer hosts are not supported by this connect-back transport.
+ /// Registers a test host launcher for Windows test applications. Packaged, full-trust MSIX desktop
+ /// hosts are registered with the OS and activated by Application User Model ID in the Windows build
+ /// of this extension (see https://github.com/microsoft/testfx/issues/9933); the plain build rejects
+ /// a packaged layout with an actionable error. True UWP/AppContainer hosts are not supported by this
+ /// connect-back transport.
///
+ ///
+ /// The launcher only enables itself when the test application is a packaged layout, so calling this
+ /// from an app that is started normally — an unpackaged WinUI app, or an ordinary console test app —
+ /// leaves the platform on its default launch path and costs nothing. Set
+ /// TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER to always to opt a non-packaged (loose) layout
+ /// into deploy-and-launch, or to never to disable the launcher entirely.
+ ///
/// The test application builder.
public static void AddPackagedAppDeployment(this ITestApplicationBuilder builder)
{
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs
index 5ecc235b48..6bfd764730 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs
@@ -11,10 +11,10 @@ namespace Microsoft.Testing.Extensions.PackagedApp;
///
/// An for Windows test applications. It handles two layouts:
-/// a non-packaged (loose-layout) host — for example unpackaged WinUI — which is deployed into an
-/// isolated directory and launched from there; and a packaged, full-trust MSIX desktop host, which
-/// cannot be started with Process.Start and is instead registered with the OS and activated by
-/// Application User Model ID (AUMID).
+/// a packaged, full-trust MSIX desktop host, which cannot be started with Process.Start and is
+/// instead registered with the OS and activated by Application User Model ID (AUMID); and — when
+/// explicitly opted in — a non-packaged (loose-layout) host, which is deployed into an isolated
+/// directory and launched from there.
///
///
///
@@ -39,8 +39,8 @@ namespace Microsoft.Testing.Extensions.PackagedApp;
/// there, and the controller pipe is not granted the package SID. The full register-and-activate path
/// ships only in the Windows build of this extension (net*-windows10.0.19041.0), where the
/// PackageManager WinRT projection is available. The plain net8.0/net9.0 build
-/// still deploys and launches non-packaged loose layouts, but rejects a packaged layout with an
-/// actionable error so a consumer that resolves that build is told to target a Windows TFM. Registering
+/// still deploys and launches an opted-in non-packaged loose layout, but rejects a packaged layout with
+/// an actionable error so a consumer that resolves that build is told to target a Windows TFM. Registering
/// an unsigned build-output layout additionally requires Developer Mode (or sideloading) to be enabled
/// on the machine.
///
@@ -49,9 +49,58 @@ namespace Microsoft.Testing.Extensions.PackagedApp;
/// the PID handshake, and the lifetime-handler dispatch; this launcher only performs the
/// deploy/register-and-create step and returns an the platform monitors.
///
+///
+/// Registering an enabled launcher forces the platform onto the test host controller
+/// (process restart) model, because a custom launcher only has an effect when an out-of-process test
+/// host is started. That is the right trade for a packaged app, which genuinely cannot be started in
+/// place, but it is pure overhead for an app that is simply started with Process.Start — most
+/// notably an unpackaged WinUI test app, which additionally does not want its layout copied
+/// to a deployment directory. The launcher therefore reports itself enabled only when it actually has
+/// work to do; see .
+///
///
internal sealed class PackagedAppTestHostLauncher : ITestHostLauncher
{
+ ///
+ /// The environment variable that overrides how the launcher decides whether to take over the test
+ /// host launch. Accepted values are auto (the default when unset), always and
+ /// never, compared case-insensitively; any other value is treated as auto rather than
+ /// failing a run over a typo in an environment variable.
+ ///
+ internal const string LauncherModeEnvironmentVariable = "TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER";
+
+ /// Always take over the launch, even for a non-packaged (loose) layout.
+ private const string AlwaysMode = "always";
+
+ /// Never take over the launch, even for a packaged layout.
+ private const string NeverMode = "never";
+
+#if PACKAGEDAPP_WINRT
+ // The prefix of the environment variables the platform uses for the controller-to-host connect-back
+ // (pipe name, correlation id, parent PID, start time, skip-extension flag). Only these are handed off
+ // to the activated packaged host: they are exactly what the host needs to reach its controller, they
+ // contain no user-provided data (unlike broader TESTINGPLATFORM_* variables such as inline
+ // runsettings, which can carry secrets), and they are read after this extension's builder hook runs.
+ private const string ConnectBackEnvironmentVariablePrefix = "TESTINGPLATFORM_TESTHOSTCONTROLLER_";
+#endif
+
+ private readonly string _testApplicationDirectory;
+ private readonly Func _getEnvironmentVariable;
+
+ public PackagedAppTestHostLauncher()
+ // The controller process runs the very test application whose host is about to be launched, so
+ // its base directory is the layout the platform will ask this launcher to start. The launch
+ // context (which carries the authoritative path) does not exist yet when enablement is decided.
+ : this(AppContext.BaseDirectory, Environment.GetEnvironmentVariable)
+ {
+ }
+
+ internal PackagedAppTestHostLauncher(string testApplicationDirectory, Func getEnvironmentVariable)
+ {
+ _testApplicationDirectory = testApplicationDirectory;
+ _getEnvironmentVariable = getEnvironmentVariable;
+ }
+
public string Uid => nameof(PackagedAppTestHostLauncher);
public string Version => ExtensionVersion.DefaultSemVer;
@@ -60,10 +109,47 @@ internal sealed class PackagedAppTestHostLauncher : ITestHostLauncher
public string Description => ExtensionResources.PackagedAppExtensionDescription;
- // Packaged Windows apps (UWP/WinUI) are a Windows-only concept. On other operating systems the
- // launcher stays disabled so it is never registered, which keeps the platform on its default
- // in-process/Process.Start path instead of forcing the controller (deploy-and-launch) host.
- public Task IsEnabledAsync() => Task.FromResult(OperatingSystem.IsWindows());
+ ///
+ /// Reports whether this launcher should take over starting the test host.
+ ///
+ ///
+ ///
+ /// Enabling a launcher is not free: the platform switches to the test host controller (process
+ /// restart) model for the whole run. The launcher therefore opts in only when the layout really
+ /// needs it — that is, when it is a packaged (MSIX) layout, which cannot be started with
+ /// Process.Start at all. A non-packaged layout (an ordinary console test app, or an
+ /// unpackaged WinUI app) is left to the platform's default in-process/Process.Start path, so
+ /// referencing this package in such an app costs nothing and never copies its layout to a
+ /// deployment directory.
+ ///
+ ///
+ /// Packaged Windows apps (UWP/WinUI) are a Windows-only concept, so the launcher stays disabled on
+ /// every other operating system regardless of the layout or the override.
+ ///
+ ///
+ /// overrides the layout probe: always opts an
+ /// explicitly non-packaged (loose) layout into deploy-and-launch, and never is the escape
+ /// hatch that keeps the launcher out of the way even for a packaged layout.
+ ///
+ ///
+ /// A task producing when the launcher should be registered.
+ public Task IsEnabledAsync() => Task.FromResult(IsEnabled());
+
+ private bool IsEnabled()
+ {
+ if (!OperatingSystem.IsWindows())
+ {
+ return false;
+ }
+
+ string? mode = _getEnvironmentVariable(LauncherModeEnvironmentVariable)?.Trim();
+
+ // 'never' wins over everything (escape hatch), 'always' opts a loose layout in, and anything
+ // else — including an unset or misspelled value — falls back to probing the layout.
+ return !string.Equals(mode, NeverMode, StringComparison.OrdinalIgnoreCase)
+ && (string.Equals(mode, AlwaysMode, StringComparison.OrdinalIgnoreCase)
+ || AppxManifestInfo.FindManifestPath(_testApplicationDirectory) is not null);
+ }
public async Task LaunchTestHostAsync(TestHostLaunchContext context, CancellationToken cancellationToken)
{
@@ -73,11 +159,11 @@ public async Task LaunchTestHostAsync(TestHostLaunchContext con
string sourceDirectory = Path.GetDirectoryName(context.FileName)
?? throw new InvalidOperationException($"Unable to determine the source directory of '{context.FileName}'.");
- // A packaged (MSIX) app is detected by the presence of an AppxManifest.xml. The manifest lives
- // at the package layout root, which may be an ancestor of the executable's directory
+ // A packaged (MSIX) app is detected by a matching AppxManifest.xml. The manifest lives at the
+ // package layout root, which may be an ancestor of the executable's directory
// (Application/@Executable can point into a subdirectory), so search upward rather than only the
- // executable's directory.
- string? manifestPath = AppxManifestInfo.FindManifestPath(sourceDirectory);
+ // executable's directory while rejecting stray ancestor manifests that do not describe this host.
+ string? manifestPath = AppxManifestInfo.FindManifestPath(sourceDirectory, context.FileName);
if (manifestPath is not null)
{
return await LaunchPackagedAsync(context, manifestPath, cancellationToken).ConfigureAwait(false);
@@ -89,13 +175,6 @@ public async Task LaunchTestHostAsync(TestHostLaunchContext con
}
#if PACKAGEDAPP_WINRT
- // The prefix of the environment variables the platform uses for the controller-to-host connect-back
- // (pipe name, correlation id, parent PID, start time, skip-extension flag). Only these are handed off
- // to the activated packaged host: they are exactly what the host needs to reach its controller, they
- // contain no user-provided data (unlike broader TESTINGPLATFORM_* variables such as inline
- // runsettings, which can carry secrets), and they are read after this extension's builder hook runs.
- private const string ConnectBackEnvironmentVariablePrefix = "TESTINGPLATFORM_TESTHOSTCONTROLLER_";
-
private static async Task LaunchPackagedAsync(TestHostLaunchContext context, string manifestPath, CancellationToken cancellationToken)
{
var manifestInfo = AppxManifestInfo.ReadFromManifest(manifestPath);
@@ -103,7 +182,7 @@ private static async Task LaunchPackagedAsync(TestHostLaunchCon
// Resolve the application matching the executable the platform asked to launch so activation
// targets the AUMID of the right app (a package can declare several applications). A package
// that declares no application has no AUMID to activate.
- AppxApplicationInfo application = manifestInfo.ResolveApplication(Path.GetFileName(context.FileName))
+ AppxApplicationInfo application = manifestInfo.ResolveApplication(Path.GetDirectoryName(manifestPath)!, context.FileName)
?? throw new InvalidOperationException(
string.Format(
CultureInfo.CurrentCulture,
@@ -185,7 +264,7 @@ private static Task LaunchPackagedAsync(TestHostLaunchContext c
// cannot host the run.
_ = cancellationToken;
var manifestInfo = AppxManifestInfo.ReadFromManifest(manifestPath);
- AppxApplicationInfo? application = manifestInfo.ResolveApplication(Path.GetFileName(context.FileName));
+ AppxApplicationInfo? application = manifestInfo.ResolveApplication(Path.GetDirectoryName(manifestPath)!, context.FileName);
throw new InvalidOperationException(
string.Format(
CultureInfo.CurrentCulture,
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx
index e249734e88..37896699d1 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx
@@ -118,7 +118,8 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
@@ -126,6 +127,10 @@
The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+
The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf
index 0415d71fc2..b91ed9c08c 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.cs.xlf
@@ -7,15 +7,20 @@
Manifest zabalené aplikace deklaruje více aplikací a žádná jednoznačně neodpovídá spustitelnému souboru '{0}'. Kandidátní ID modelu uživatele aplikace: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Manifest zabalené aplikace nedeklaruje platný prvek <Identity Name="..." Publisher="..." />.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Nasadí nezabaleného hostitele testů Windows s volným rozložením souborů (například nezabalené WinUI) do izolovaného adresáře a spustí ho odtud a – v sestavení Windows – zaregistruje zabaleného desktopového hostitele testů MSIX s plnou důvěryhodností a aktivuje ho pomocí Application User Model ID. Skuteční hostitelé UWP/AppContainer nejsou podporováni. Viz https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Nasadí nezabaleného hostitele testů Windows s volným rozložením souborů (například nezabalené WinUI) do izolovaného adresáře a spustí ho odtud a – v sestavení Windows – zaregistruje zabaleného desktopového hostitele testů MSIX s plnou důvěryhodností a aktivuje ho pomocí Application User Model ID. Skuteční hostitelé UWP/AppContainer nejsou podporováni. Viz https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf
index 4a28f909c1..307cafc470 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.de.xlf
@@ -7,15 +7,20 @@
Das App-Paketmanifest deklariert mehrere Anwendungen, und keine davon stimmt eindeutig mit der ausführbaren Datei „{0}“ überein. Benutzermodell-IDs der Kandidatenanwendungen: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Das App-Paketmanifest deklariert kein gültiges <Identity Name="..." Publisher="..." /> Element.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Stellt einen nicht gepackten Windows-Testhost (loses Layout) (z. B. entpackte WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. Im Windows-Build wird ein gepackter, voll vertrauenswürdiger MSIX-Desktoptesthost registriert und anhand der Anwendungsbenutzermodell-ID aktiviert. Echte UWP-/AppContainer-Hosts werden nicht unterstützt. Siehe https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Stellt einen nicht gepackten Windows-Testhost (loses Layout) (z. B. entpackte WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. Im Windows-Build wird ein gepackter, voll vertrauenswürdiger MSIX-Desktoptesthost registriert und anhand der Anwendungsbenutzermodell-ID aktiviert. Echte UWP-/AppContainer-Hosts werden nicht unterstützt. Siehe https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf
index 68335fb507..1032c30bdb 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.es.xlf
@@ -7,15 +7,20 @@
El manifiesto de aplicación empaquetada declara varias aplicaciones y ninguna coincide de forma única con el ejecutable "{0}". Identificadores de modelo de usuario de la aplicación candidata: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Implementa un host de prueba de Windows no empaquetado (diseño flexible) (por ejemplo, WinUI sin empaquetar) en un directorio aislado y lo inicia desde allí y, en la compilación de Windows, registra un host de prueba de escritorio MSIX empaquetado y de plena confianza y lo activa mediante el identificador del modelo de usuario de aplicación. No se admiten los hosts verdaderos de UWP/AppContainer. Consulte https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Implementa un host de prueba de Windows no empaquetado (diseño flexible) (por ejemplo, WinUI sin empaquetar) en un directorio aislado y lo inicia desde allí y, en la compilación de Windows, registra un host de prueba de escritorio MSIX empaquetado y de plena confianza y lo activa mediante el identificador del modelo de usuario de aplicación. No se admiten los hosts verdaderos de UWP/AppContainer. Consulte https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf
index 6f4445ea5e..c50b3d769d 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.fr.xlf
@@ -7,15 +7,20 @@
Le manifeste de l’application packagée déclare plusieurs applications et aucune ne correspond de manière unique à l’exécutable « {0} ». ID de modèle d’utilisateur d’application candidat : {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf
index 6e4c029191..e2ad968f67 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.it.xlf
@@ -7,15 +7,20 @@
Il manifesto dell'app in pacchetto dichiara più applicazioni e nessuna corrisponde in modo univoco all'eseguibile '{0}'. ID modello utente applicazione candidata: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Il manifesto dell'app in pacchetto non dichiara un elemento <Identity Name="..." Publisher="..." /> valido.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Distribuisce un host di test di Windows non in pacchetto, o a layout libero (ad esempio, WinUI non in pacchetto), in una directory isolata, da cui lo avvia, e nella build di Windows registra un host di test desktop MSIX in pacchetto con attendibilità totale e lo attiva in base all'ID modello utente applicazione. Gli host UWP/AppContainer effettivi non sono supportati. Vedere https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Distribuisce un host di test di Windows non in pacchetto, o a layout libero (ad esempio, WinUI non in pacchetto), in una directory isolata, da cui lo avvia, e nella build di Windows registra un host di test desktop MSIX in pacchetto con attendibilità totale e lo attiva in base all'ID modello utente applicazione. Gli host UWP/AppContainer effettivi non sono supportati. Vedere https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf
index 2f54102736..a32ad0c852 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ja.xlf
@@ -7,15 +7,20 @@
パッケージ化されたアプリ マニフェストで複数のアプリケーションが宣言されており、実行可能ファイル '{0}' に一意に一致するものがありません。候補のアプリケーション ユーザー モデル ID: {1}。
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.パッケージ アプリ マニフェストに有効な <Identity Name="..." Publisher="..." />要素が宣言されていません。
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- パッケージ化されていない (loose-layout) Windows テスト ホスト (例: パッケージ化されていない WinUI) を分離ディレクトリに配置してそこから起動します。また、Windows ビルドでは、パッケージ化されたフル トラストの MSIX デスクトップ テスト ホストを登録して、アプリケーション ユーザー モデル ID によってアクティブ化します。実際の UWP/AppContainer ホストはサポートされていません。https://github.com/microsoft/testfx/issues/9933 を参照してください。
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ パッケージ化されていない (loose-layout) Windows テスト ホスト (例: パッケージ化されていない WinUI) を分離ディレクトリに配置してそこから起動します。また、Windows ビルドでは、パッケージ化されたフル トラストの MSIX デスクトップ テスト ホストを登録して、アプリケーション ユーザー モデル ID によってアクティブ化します。実際の UWP/AppContainer ホストはサポートされていません。https://github.com/microsoft/testfx/issues/9933 を参照してください。
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf
index 8b8a99a50a..888436e9f0 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ko.xlf
@@ -7,15 +7,20 @@
패키지된 앱 매니페스트는 여러 애플리케이션을 선언하지만 실행 파일 '{0}'에 고유하게 일치하는 애플리케이션이 없습니다. 후보 애플리케이션 사용자 모델 ID: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.패키지된 앱 매니페스트에 유효한 <Identity Name="..." Publisher="..." /> 요소가 선언되어 있지 않습니다.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- 패키지되지 않은(느슨한 레이아웃) Windows 테스트 호스트(예: 패키지되지 않은 WinUI)를 격리된 디렉터리에 배포한 다음, 그 위치에서 시작합니다. 그리고 Windows 빌드에서는 패키지된 완전 신뢰 MSIX 데스크톱 테스트 호스트를 등록하고 애플리케이션 사용자 모델 ID로 활성화합니다. 신뢰 UWP/AppContainer 호스트는 지원되지 않습니다. https://github.com/microsoft/testfx/issues/9933을 참조하세요.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ 패키지되지 않은(느슨한 레이아웃) Windows 테스트 호스트(예: 패키지되지 않은 WinUI)를 격리된 디렉터리에 배포한 다음, 그 위치에서 시작합니다. 그리고 Windows 빌드에서는 패키지된 완전 신뢰 MSIX 데스크톱 테스트 호스트를 등록하고 애플리케이션 사용자 모델 ID로 활성화합니다. 신뢰 UWP/AppContainer 호스트는 지원되지 않습니다. https://github.com/microsoft/testfx/issues/9933을 참조하세요.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf
index 6da6127b11..5fc253fd76 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pl.xlf
@@ -7,15 +7,20 @@
Manifest spakowanej aplikacji deklaruje wiele aplikacji i żaden z nich nie jest jednoznacznie zgodny z plikiem wykonywalnym „{0}”. Identyfikatory modelu użytkownika aplikacji (Application User Model ID): {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Manifest spakowanej aplikacji nie deklaruje prawidłowego <Identity Name="..." Publisher="..." /> element.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf
index 3a7ba36591..6920f0953f 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.pt-BR.xlf
@@ -7,15 +7,20 @@
O manifesto do aplicativo empacotado declara vários aplicativos e nenhum corresponde exclusivamente ao executável ''{0}''. IDs de Modelo de Usuário do Aplicativo Candidato: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.O manifesto do aplicativo empacotado não declara um elemento <Identity Name="..." Publisher="..." /> válido.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Implanta um host de teste do Windows não empacotado (layout solto), como um aplicativo WinUI não empacotado, em um diretório isolado e o inicia a partir desse diretório. Na compilação do Windows, também registra um host de teste de área de trabalho MSIX empacotado, com confiança total, e o ativa por meio da ID do Modelo de Usuário do Aplicativo. Não há suporte para hosts UWP/AppContainer verdadeiros. Veja https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Implanta um host de teste do Windows não empacotado (layout solto), como um aplicativo WinUI não empacotado, em um diretório isolado e o inicia a partir desse diretório. Na compilação do Windows, também registra um host de teste de área de trabalho MSIX empacotado, com confiança total, e o ativa por meio da ID do Modelo de Usuário do Aplicativo. Não há suporte para hosts UWP/AppContainer verdadeiros. Veja https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf
index 710c6154b2..bd5474fb5e 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.ru.xlf
@@ -7,15 +7,20 @@
Манифест упакованного приложения объявляет несколько приложений, и ни одно из них не соответствует однозначно исполняемому файлу "{0}". Идентификаторы пользовательской модели приложений-кандидатов: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Манифест упакованного приложения не объявляет допустимый элемент <Identity Name="..." Publisher="..." />.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Развертывает неупакованный (со свободной компоновкой) тестовый узел Windows (например, неупакованный WinUI) в изолированный каталог и запускает его оттуда, а в сборке Windows регистрирует упакованный тестовый узел классической версии MSIX с полным доверием и активирует его по идентификатору пользовательской модели приложения. Настоящие узлы UWP/AppContainer не поддерживаются. Сведения: https://github.com/microsoft/testfx/issues/9933.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Развертывает неупакованный (со свободной компоновкой) тестовый узел Windows (например, неупакованный WinUI) в изолированный каталог и запускает его оттуда, а в сборке Windows регистрирует упакованный тестовый узел классической версии MSIX с полным доверием и активирует его по идентификатору пользовательской модели приложения. Настоящие узлы UWP/AppContainer не поддерживаются. Сведения: https://github.com/microsoft/testfx/issues/9933.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf
index c873524c98..ca2b8f7950 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.tr.xlf
@@ -7,15 +7,20 @@
Paketlenmiş uygulama bildirimi birden çok uygulama bildiriyor ve bunların hiçbiri benzersiz olarak '{0}' yürütülebilir dosyasıyla eşleşmiyor. Aday Uygulama Kullanıcı Modeli Kimlikleri: {1}.
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.Paketlenmiş uygulama bildirimi geçerli bir <Identity Name="..." Publisher="..." /> öğesi belirtmiyor.
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- Paketlenmemiş (gevşek düzenli) bir Windows test konağını (örneğin, paketlenmemiş WinUI) yalıtılmış bir dizine dağıtır ve oradan başlatır ve — Windows derlemesinde — paketlenmiş, tam güvenilir bir MSIX masaüstü test konağını kaydeder ve onu Uygulama Kullanıcı Modeli Kimliği ile etkinleştirir. Gerçek UWP/AppContainer konakları desteklenmez. https://github.com/microsoft/testfx/issues/9933 bağlantısına bakın.
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ Paketlenmemiş (gevşek düzenli) bir Windows test konağını (örneğin, paketlenmemiş WinUI) yalıtılmış bir dizine dağıtır ve oradan başlatır ve — Windows derlemesinde — paketlenmiş, tam güvenilir bir MSIX masaüstü test konağını kaydeder ve onu Uygulama Kullanıcı Modeli Kimliği ile etkinleştirir. Gerçek UWP/AppContainer konakları desteklenmez. https://github.com/microsoft/testfx/issues/9933 bağlantısına bakın.
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf
index dbb58cd9cf..bb2ae26631 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hans.xlf
@@ -7,15 +7,20 @@
打包应用部件清单声明了多个应用程序,而没有一个与可执行文件 '{0}' 唯一匹配。候选应用程序用户模型 ID: {1}。
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.打包应用部件清单未声明有效的 <Identity Name="..." Publisher="..." /> 元素。
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- 将非打包(松散布局)的 Windows 测试主机(例如,未打包的 WinUI)部署到隔离目录,并从该目录启动它;在 Windows 构建中,还会注册一个打包、完全信任的 MSIX 桌面测试主机,并通过应用程序用户模型 ID 激活它。不支持真正的 UWP/AppContainer 主机。请参阅 https://github.com/microsoft/testfx/issues/9933。
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ 将非打包(松散布局)的 Windows 测试主机(例如,未打包的 WinUI)部署到隔离目录,并从该目录启动它;在 Windows 构建中,还会注册一个打包、完全信任的 MSIX 桌面测试主机,并通过应用程序用户模型 ID 激活它。不支持真正的 UWP/AppContainer 主机。请参阅 https://github.com/microsoft/testfx/issues/9933。
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf
index 0b18735871..4271492d85 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/xlf/ExtensionResources.zh-Hant.xlf
@@ -7,15 +7,20 @@
封裝的應用程式資訊清單會宣告多個應用程式,且沒有一個能唯一地符合可執行檔 '{0}'。候選應用程式使用者模型識別碼: {1}。
+
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ The packaged app manifest declares no application for the executable '{0}', so it describes a different application and activating it would target the wrong Application User Model ID. Declared application executables: {1}.
+ Do not localize the technology name {Locked="Application User Model ID"}. {0} is an executable path. {1} is a comma-separated list of executable paths.
+ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element.封裝的應用程式清單未宣告有效的 <Identity Name="..." Publisher="..." /> 元素。
- Deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) to an isolated directory and launches it from there, and — in the Windows build — registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
- 將未封裝 (鬆散配置) 的 Windows 測試主機 (例如未封裝的 WinUI) 部署到隔離目錄,並從該處啟動它,然後在 Windows 組建中註冊封裝、完全信任的 MSIX 桌面測試主機,並透過應用程式使用者模型識別碼來啟用它。不支援真正的 UWP/AppContainer 主機。請參閱 https://github.com/microsoft/testfx/issues/9933。
-
+ Registers a packaged, full-trust MSIX desktop test host and activates it by Application User Model ID (Windows build), and — when opted in through TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER=always — deploys a non-packaged (loose-layout) Windows test host to an isolated directory and launches it from there. Enabled only for a packaged layout by default, so an unpackaged app is left on the default launch path. True UWP/AppContainer hosts are not supported. See https://github.com/microsoft/testfx/issues/9933.
+ 將未封裝 (鬆散配置) 的 Windows 測試主機 (例如未封裝的 WinUI) 部署到隔離目錄,並從該處啟動它,然後在 Windows 組建中註冊封裝、完全信任的 MSIX 桌面測試主機,並透過應用程式使用者模型識別碼來啟用它。不支援真正的 UWP/AppContainer 主機。請參閱 https://github.com/microsoft/testfx/issues/9933。
+ Do not localize the environment variable name or its value {Locked="TESTINGPLATFORM_PACKAGEDAPP_LAUNCHER"}{Locked="always"}, nor the technology names {Locked="MSIX"}{Locked="Application User Model ID"}{Locked="Windows"}{Locked="UWP"}{Locked="AppContainer"}.Packaged app test host launcher
diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs
index e1aaab5eb4..c94d5250e4 100644
--- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs
+++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs
@@ -6,14 +6,16 @@
namespace Microsoft.Testing.Extensions.PackagedApp;
///
-/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add Windows test host deployment support (non-packaged loose layouts such as unpackaged WinUI, and packaged, full-trust MSIX desktop apps launched by AUMID activation).
+/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add Windows test host launch support (packaged, full-trust MSIX desktop apps activated by AUMID, and — when opted in — non-packaged loose layouts deployed to an isolated directory).
///
public static class TestingPlatformBuilderHook
{
///
- /// Adds Windows test host deployment support to the Testing Platform Builder: it deploys and
- /// launches non-packaged (loose-layout) hosts, and — in the Windows build — registers and activates
- /// packaged, full-trust MSIX desktop hosts by Application User Model ID (see https://github.com/microsoft/testfx/issues/9933).
+ /// Adds Windows test host launch support to the Testing Platform Builder: it registers and activates
+ /// packaged, full-trust MSIX desktop hosts by Application User Model ID in the Windows build (see
+ /// https://github.com/microsoft/testfx/issues/9933), and deploys and launches an opted-in
+ /// non-packaged (loose-layout) host. Because this hook runs for anyone who merely references the
+ /// package, the launcher stays disabled unless the test application is a packaged layout.
///
/// The test application builder.
/// The command line arguments.
diff --git a/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs b/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs
index 90ee952430..9af9f29f3d 100644
--- a/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs
+++ b/src/TestFramework/TestFramework.Extensions/Attributes/WinUI_UITestMethodAttribute.cs
@@ -12,8 +12,33 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
///
public class UITestMethodAttribute : TestMethodAttribute
{
- private static bool s_isApplicationInitialized;
- private static DispatcherQueue? s_applicationDispatcherQueue;
+ // How often the application-startup wait re-checks that the UI thread is still alive. Short enough
+ // that a failed startup is reported promptly, long enough not to spin.
+ private static readonly TimeSpan ThreadLivenessPollInterval = TimeSpan.FromMilliseconds(100);
+
+ // Upper bound on how long to wait for the application to come up. Application.Start can block without
+ // ever invoking its callback (for example a modal dialog during XAML initialization), which neither an
+ // exception nor the thread dying would surface, so the wait is capped to keep a startup problem a test
+ // failure rather than a hung run. Generous because it covers first-run Windows App SDK resolution.
+ private static readonly TimeSpan ApplicationStartupTimeout = TimeSpan.FromMinutes(2);
+
+ // Serializes the check-and-start below. Application.Start can only be called once per process, so
+ // without this two [UITestMethod]s running in parallel could both observe "not started yet" and each
+ // start an application.
+ private static readonly object InitializationLock = new();
+
+ // Written on the UI thread and read on the test thread, so all three are volatile: this runs on ARM64
+ // as well as x64, where non-volatile reads are not guaranteed to observe the writes.
+ private static volatile bool s_isApplicationInitialized;
+ private static volatile DispatcherQueue? s_applicationDispatcherQueue;
+
+ // Why bringing the application up failed, so that every later [UITestMethod] reports the same root
+ // cause instead of the generic "DispatcherQueue should not be null" message. The cause is stored
+ // rather than an ExceptionDispatchInfo because replaying one dispatch token from several test threads
+ // would mutate the stack trace of a single shared exception; each caller instead gets a fresh
+ // exception wrapping this one. Application.Start cannot meaningfully be retried in a process, so
+ // re-reporting is better than re-attempting.
+ private static volatile Exception? s_applicationInitializationFailure;
///
/// Initializes a new instance of the class.
@@ -93,33 +118,58 @@ public override async Task ExecuteAsync(ITestMethod testMethod)
return s_applicationDispatcherQueue;
}
- if (s_isApplicationInitialized)
+ // Application.Start can only be called once per process, so the whole check-and-start has to be
+ // serialized: otherwise two [UITestMethod]s running in parallel can both see "not started yet".
+ lock (InitializationLock)
{
- return null;
- }
+ if (s_applicationDispatcherQueue != null)
+ {
+ return s_applicationDispatcherQueue;
+ }
- Type? applicationType = GetApplicationType(assembly);
- if (applicationType == null)
- {
- return null;
- }
+ // A previous attempt already failed to bring the application up, and Application.Start cannot
+ // be retried in the same process. Report that cause instead of letting the caller fall through
+ // to the generic "DispatcherQueue should not be null" message. A new exception is built per
+ // caller so concurrent tests never share (and mutate) one exception instance.
+ if (s_applicationInitializationFailure is { } cause)
+ {
+ // The cause's message is formatted into the text rather than relying on the inner
+ // exception alone: MSTest reports a failure using the exception's Message, so an
+ // InnerException would never be shown to the user. It is still attached for debuggers
+ // and for anyone inspecting the exception programmatically.
+ throw new InvalidOperationException(
+ string.Format(CultureInfo.CurrentCulture, FrameworkExtensionsMessages.WinUIApplicationInitializationAlreadyFailed, cause.Message),
+ cause);
+ }
- // We need to initialize the SDK before calling Application.Start
- try
- {
- // We need to execute all module initializers before doing any WinRT calls.
- // This will cause the [ModuleInitializer]s to execute, if they haven't yet.
- Type? id = applicationType.Assembly.GetType("Microsoft.WindowsAppSDK.Runtime.Identity");
- if (id != null)
+ if (s_isApplicationInitialized)
+ {
+ return null;
+ }
+
+ Type? applicationType = GetApplicationType(assembly);
+ if (applicationType == null)
+ {
+ return null;
+ }
+
+ // We need to initialize the SDK before calling Application.Start
+ try
+ {
+ // We need to execute all module initializers before doing any WinRT calls.
+ // This will cause the [ModuleInitializer]s to execute, if they haven't yet.
+ Type? id = applicationType.Assembly.GetType("Microsoft.WindowsAppSDK.Runtime.Identity");
+ if (id != null)
+ {
+ _ = Activator.CreateInstance(id);
+ }
+ }
+ catch
{
- _ = Activator.CreateInstance(id);
}
- }
- catch
- {
- }
- return InitializeApplication(applicationType);
+ return InitializeApplication(applicationType);
+ }
}
private static DispatcherQueue? GetDispatcherQueue(Assembly assembly)
@@ -162,15 +212,42 @@ void OnApplicationInitialized(ApplicationInitializationCallbackParams e)
_ = Activator.CreateInstance(applicationType) as Application;
s_applicationDispatcherQueue = dispatcher;
- tsc.SetResult(dispatcher);
+ tsc.TrySetResult(dispatcher);
}
- catch
+ catch (Exception ex)
{
+ // Never leave the wait below blocked. This used to swallow the exception, which left the
+ // TaskCompletionSource incomplete and hung the whole run on tsc.Task with no diagnostic at
+ // all. The common causes are a throwing Application constructor and — in an unpackaged app
+ // — the Windows App SDK runtime not being resolvable, which surfaces here as a COMException
+ // (REGDB_E_CLASSNOTREG). Propagate it so the test fails with the real cause. See issue #2784.
+ //
+ // Unwrap the reflection wrapper: MSTest reports a failure using the exception's Message, so
+ // leaving a TargetInvocationException in place would tell the user only "Exception has been
+ // thrown by the target of an invocation" and bury the real cause in the stack trace.
+ tsc.TrySetException(ex is TargetInvocationException { InnerException: { } inner } ? inner : ex);
}
}
- var treadStart = new ThreadStart(() => Application.Start(OnApplicationInitialized));
- var uiThread = new Thread(treadStart)
+ var threadStart = new ThreadStart(() =>
+ {
+ try
+ {
+ Application.Start(OnApplicationInitialized);
+
+ // Application.Start normally pumps a message loop until the app exits, so reaching this
+ // point without the callback having completed the wait means the application never came up.
+ tsc.TrySetException(new InvalidOperationException(FrameworkExtensionsMessages.WinUIApplicationFailedToStart));
+ }
+ catch (Exception ex)
+ {
+ // Application.Start can throw before it ever invokes the callback above (typically when the
+ // Windows App SDK runtime cannot be resolved). Without this the exception would be unhandled
+ // on this thread and the wait below would never be released.
+ tsc.TrySetException(ex);
+ }
+ });
+ var uiThread = new Thread(threadStart)
{
Name = "UI Thread for Tests",
@@ -181,9 +258,72 @@ void OnApplicationInitialized(ApplicationInitializationCallbackParams e)
IsBackground = true,
};
uiThread.Start();
- tsc.Task.Wait();
- return tsc.Task.Result;
+ // Wait for the application to come up, but never unconditionally. Two things can leave the wait
+ // incomplete and used to hang the whole run with no diagnostic at all (see issue #2784):
+ // - XAML tears this thread down for some native startup failures without surfacing a managed
+ // exception, so neither catch above runs. A dead thread therefore counts as a failure.
+ // - Startup can stall while the thread stays alive: Application.Start may block without ever
+ // invoking its callback (for example a modal dialog during XAML initialization), or the
+ // callback may block constructing the application. The overall timeout covers both.
+ // On success the callback completes the wait while the thread keeps pumping, so this costs at
+ // most one poll interval.
+ WaitForApplicationStartup(tsc, uiThread.Join, ApplicationStartupTimeout, ThreadLivenessPollInterval);
+
+ try
+ {
+ // GetAwaiter().GetResult() rather than Wait()/Result so a failure surfaces as the original
+ // exception instead of an AggregateException wrapping it.
+ return tsc.Task.GetAwaiter().GetResult();
+ }
+ catch (Exception ex)
+ {
+ // Remember why startup failed so later [UITestMethod]s report the same cause instead of a
+ // generic message. A bare 'throw' preserves the original stack.
+ s_applicationInitializationFailure = ex;
+ throw;
+ }
+ }
+
+ ///
+ /// Waits for application startup to complete, and fails the wait rather than blocking forever when
+ /// the UI thread dies or startup stalls.
+ ///
+ ///
+ /// Separated from the thread it observes so that both failure paths can be covered by tests without a
+ /// real XAML application: they are the guards that keep a startup problem a test failure rather than
+ /// the hung run described in issue #2784, and neither is reproducible on demand from a test host.
+ ///
+ /// The result the startup completion carries.
+ /// Completed by the initialization callback once the application is up.
+ /// Waits the given interval for the UI thread to exit, returning whether it did.
+ /// How long startup may take before it is reported as stalled.
+ /// How long each liveness check waits for the UI thread to exit.
+ internal static void WaitForApplicationStartup(
+ TaskCompletionSource startupCompletion,
+ Func waitForUiThreadExit,
+ TimeSpan timeout,
+ TimeSpan pollInterval)
+ {
+ var startupTimer = Stopwatch.StartNew();
+ while (!startupCompletion.Task.IsCompleted)
+ {
+ if (waitForUiThreadExit(pollInterval))
+ {
+ startupCompletion.TrySetException(new InvalidOperationException(FrameworkExtensionsMessages.WinUIApplicationFailedToStart));
+ return;
+ }
+
+ if (startupTimer.Elapsed > timeout)
+ {
+ // The thread is still alive, so the application did not exit — it never finished coming
+ // up. Say that rather than reusing the "exited without initializing" message, which would
+ // point at the wrong cause.
+ startupCompletion.TrySetException(new TimeoutException(
+ string.Format(CultureInfo.CurrentCulture, FrameworkExtensionsMessages.WinUIApplicationStartupTimedOut, timeout)));
+ return;
+ }
+ }
}
}
#endif
diff --git a/src/TestFramework/TestFramework.Extensions/Resources/FrameworkExtensionsMessages.resx b/src/TestFramework/TestFramework.Extensions/Resources/FrameworkExtensionsMessages.resx
index ab5b382a34..6381bdf397 100644
--- a/src/TestFramework/TestFramework.Extensions/Resources/FrameworkExtensionsMessages.resx
+++ b/src/TestFramework/TestFramework.Extensions/Resources/FrameworkExtensionsMessages.resx
@@ -125,4 +125,16 @@
UITestMethodAttribute.DispatcherQueue should not be null. To use UITestMethodAttribute within a WinUI Desktop App, remember to set the static UITestMethodAttribute.DispatcherQueue during the test initialization.Do not localize API names {Locked="UITestMethodAttribute.DispatcherQueue"}{Locked="UITestMethodAttribute"}, the product name {Locked="WinUI"}, or the C# keyword {Locked="null"}.
+
+ The WinUI application under test exited without initializing. When running unpackaged, this usually means the Windows App SDK runtime could not be resolved for the process.
+ Do not localize the product names {Locked="WinUI"}{Locked="Windows App SDK"}.
+
+
+ The WinUI application under test did not finish initializing within {0}. Application.Start was called but its initialization did not complete.
+ Do not localize the product name {Locked="WinUI"} or the API name {Locked="Application.Start"}. {0} is a timeout duration.
+
+
+ The WinUI application under test failed to initialize earlier in this run, and Application.Start cannot be retried in the same process. The original failure was: {0}
+ Do not localize the product name {Locked="WinUI"} or the API name {Locked="Application.Start"}. {0} is the message of the original failure.
+
\ No newline at end of file
diff --git a/src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.cs.xlf b/src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.cs.xlf
index 9be8f5ed78..7eed9742cd 100644
--- a/src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.cs.xlf
+++ b/src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.cs.xlf
@@ -12,6 +12,21 @@
UITestMethodAttribute.DispatcherQueue nesmí mít hodnotu null. Pokud chcete použít UITestMethodAttribute v desktopové aplikaci WinUI, nezapomeňte během inicializace testu nastavit statický UITestMethodAttribute.DispatcherQueue.Do not localize API names {Locked="UITestMethodAttribute.DispatcherQueue"}{Locked="UITestMethodAttribute"}, the product name {Locked="WinUI"}, or the C# keyword {Locked="null"}.
+
+ The WinUI application under test exited without initializing. When running unpackaged, this usually means the Windows App SDK runtime could not be resolved for the process.
+ The WinUI application under test exited without initializing. When running unpackaged, this usually means the Windows App SDK runtime could not be resolved for the process.
+ Do not localize the product names {Locked="WinUI"}{Locked="Windows App SDK"}.
+
+
+ The WinUI application under test failed to initialize earlier in this run, and Application.Start cannot be retried in the same process. The original failure was: {0}
+ The WinUI application under test failed to initialize earlier in this run, and Application.Start cannot be retried in the same process. The original failure was: {0}
+ Do not localize the product name {Locked="WinUI"} or the API name {Locked="Application.Start"}. {0} is the message of the original failure.
+
+
+ The WinUI application under test did not finish initializing within {0}. Application.Start was called but its initialization did not complete.
+ The WinUI application under test did not finish initializing within {0}. Application.Start was called but its initialization did not complete.
+ Do not localize the product name {Locked="WinUI"} or the API name {Locked="Application.Start"}. {0} is a timeout duration.
+