From 084511acf3cafd4d2eafa40be0778a4f2e7207dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Mon, 13 Jul 2026 22:26:26 +0200 Subject: [PATCH 1/9] Improve PackagedApp extension with public-API-only groundwork The PackagedApp launcher's only real launch path was CopyDirectory + Process.Start, which cannot launch a packaged (MSIX) WinUI/UWP app; VSTest gets registration + AUMID activation from VS-internal deployment components (IVsAppContainerProjectDeploy2, IDeploymentServicesProvider) that are not redistributable. This adds the parts that need no VS-internal API: - AppxManifestInfo: parses AppxManifest.xml and computes PackageFamilyName + Application User Model ID using the public Windows publisher-hash algorithm (SHA-256 of the UTF-16LE publisher, first 8 bytes, Crockford base32). Pure managed, cross-platform, unit-tested against the well-known 8wekyb3d8bbwe vector. - IsEnabledAsync now gates on OperatingSystem.IsWindows(), so on non-Windows the launcher is never registered and the platform keeps its default in-process path (instead of being forced onto the controller/deploy path). - LaunchTestHostAsync now detects a packaged layout (AppxManifest.xml) and fails fast with an actionable message including the AUMID activation would use, referencing #2784, instead of silently starting an executable that cannot host the run. Non-packaged (loose-layout) hosts keep the existing Process.Start path. Registration (PackageManager.RegisterPackageByUriAsync) + AUMID activation (IApplicationActivationManager) and the sandbox connect-back transport remain a follow-up (#2784). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c5c7d634-e822-4475-9312-a9dde92753f6 --- .../AppxManifestInfo.cs | 157 ++++++++++++++ .../InternalAPI/InternalAPI.Unshipped.txt | 11 + ...soft.Testing.Extensions.PackagedApp.csproj | 4 + .../PackagedAppTestHostLauncher.cs | 39 +++- .../Resources/ExtensionResources.resx | 6 + .../Resources/xlf/ExtensionResources.cs.xlf | 10 + .../Resources/xlf/ExtensionResources.de.xlf | 10 + .../Resources/xlf/ExtensionResources.es.xlf | 10 + .../Resources/xlf/ExtensionResources.fr.xlf | 10 + .../Resources/xlf/ExtensionResources.it.xlf | 10 + .../Resources/xlf/ExtensionResources.ja.xlf | 10 + .../Resources/xlf/ExtensionResources.ko.xlf | 10 + .../Resources/xlf/ExtensionResources.pl.xlf | 10 + .../xlf/ExtensionResources.pt-BR.xlf | 10 + .../Resources/xlf/ExtensionResources.ru.xlf | 10 + .../Resources/xlf/ExtensionResources.tr.xlf | 10 + .../xlf/ExtensionResources.zh-Hans.xlf | 10 + .../xlf/ExtensionResources.zh-Hant.xlf | 10 + .../AppxManifestInfoTests.cs | 197 ++++++++++++++++++ ...rosoft.Testing.Extensions.UnitTests.csproj | 3 + 20 files changed, 538 insertions(+), 9 deletions(-) create mode 100644 src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs create mode 100644 test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs new file mode 100644 index 0000000000..1e9653a74d --- /dev/null +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -0,0 +1,157 @@ +// 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.Security.Cryptography; + +using Microsoft.Testing.Extensions.PackagedApp.Resources; + +namespace Microsoft.Testing.Extensions.PackagedApp; + +/// +/// The identity of a packaged Windows (UWP/WinUI) app, read from its AppxManifest.xml. +/// +/// +/// +/// A packaged app is launched by Application User Model ID (AUMID), never by +/// Process.Start. The AUMID is {PackageFamilyName}!{ApplicationId}, and the package +/// family name is {PackageName}_{publisherId} where publisherId is a 13-character hash +/// of the manifest's Publisher. VSTest reads these values from VS-internal deployment +/// components; this type computes them from the manifest using only public, cross-platform managed +/// APIs so the extension does not depend on the Visual Studio install. +/// +/// +internal sealed class AppxManifestInfo +{ + /// + /// The canonical file name of a packaged app's manifest inside its (loose or extracted) layout. + /// + internal const string AppxManifestFileName = "AppxManifest.xml"; + + // The alphabet Windows uses to encode the publisher hash (Douglas Crockford's base32: the digits + // and lowercase letters with i, l, o and u removed). Must not be reordered. + private const string PublisherHashAlphabet = "0123456789abcdefghjkmnpqrstvwxyz"; + + private AppxManifestInfo(string packageName, string publisher, string? applicationId) + { + PackageName = packageName; + Publisher = publisher; + ApplicationId = applicationId; + PackageFamilyName = $"{packageName}_{ComputePublisherId(publisher)}"; + AppUserModelId = applicationId is null ? null : $"{PackageFamilyName}!{applicationId}"; + } + + /// Gets the package name (the manifest's Identity/@Name). + public string PackageName { get; } + + /// Gets the publisher (the manifest's Identity/@Publisher). + public string Publisher { get; } + + /// + /// Gets the id of the first application declared in the manifest (Applications/Application/@Id), + /// or when the manifest declares no application. + /// + public string? ApplicationId { get; } + + /// Gets the package family name ({PackageName}_{publisherId}). + public string PackageFamilyName { get; } + + /// + /// Gets the Application User Model ID ({PackageFamilyName}!{ApplicationId}) used to activate + /// the app, or when the manifest declares no application. + /// + public string? AppUserModelId { get; } + + /// + /// Reads the manifest at the root of if the directory is a + /// packaged-app layout. + /// + /// The directory to probe for an AppxManifest.xml. + /// The parsed manifest info when the directory is a packaged-app layout. + /// + /// when an AppxManifest.xml was found and parsed; otherwise + /// . + /// + public static bool TryReadFromLayout(string layoutDirectory, [NotNullWhen(true)] out AppxManifestInfo? info) + { + string manifestPath = Path.Combine(layoutDirectory, AppxManifestFileName); + if (!File.Exists(manifestPath)) + { + info = null; + return false; + } + + info = ReadFromManifest(manifestPath); + return true; + } + + /// Reads and parses the manifest at . + /// The path to an AppxManifest.xml. + /// The parsed manifest info. + public static AppxManifestInfo ReadFromManifest(string manifestPath) + { + using FileStream stream = File.OpenRead(manifestPath); + return ReadFromManifest(stream); + } + + /// Reads and parses a manifest from . + /// A stream over an AppxManifest.xml. + /// The parsed manifest info. + public static AppxManifestInfo ReadFromManifest(Stream manifestStream) + { + var document = XDocument.Load(manifestStream); + XElement? root = document.Root; + + // Match by local name so we are resilient to the manifest schema version (the foundation + // namespace URI changes across Windows 10 SDK revisions). + XElement? identity = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Identity"); + string? name = identity?.Attribute("Name")?.Value; + string? publisher = identity?.Attribute("Publisher")?.Value; + + if (name is null || name.Length == 0 || publisher is null || publisher.Length == 0) + { + throw new InvalidOperationException(ExtensionResources.InvalidAppxManifestMissingIdentity); + } + + string? applicationId = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Applications")? + .Elements().FirstOrDefault(static e => e.Name.LocalName == "Application")? + .Attribute("Id")?.Value; + + return new AppxManifestInfo(name, publisher, applicationId); + } + + /// + /// Computes the 13-character publisher id (the suffix of the package family name) for + /// , using the public Windows algorithm: base32-encode the first 8 + /// bytes of the SHA-256 hash of the UTF-16LE publisher string. + /// + /// The manifest's Identity/@Publisher value. + /// The 13-character publisher id. + internal static string ComputePublisherId(string publisher) + { + byte[] hash = SHA256.HashData(Encoding.Unicode.GetBytes(publisher)); + + // Take the first 8 bytes (64 bits) and encode them big-endian as 13 base32 characters. 64 bits + // is not a multiple of 5, so the final character carries the 4 leftover bits padded with a 0. + var builder = new StringBuilder(13); + int buffer = 0; + int bitsInBuffer = 0; + for (int i = 0; i < 8; i++) + { + buffer = (buffer << 8) | hash[i]; + bitsInBuffer += 8; + while (bitsInBuffer >= 5) + { + bitsInBuffer -= 5; + builder.Append(PublisherHashAlphabet[(buffer >> bitsInBuffer) & 0x1F]); + buffer &= (1 << bitsInBuffer) - 1; + } + } + + if (bitsInBuffer > 0) + { + builder.Append(PublisherHashAlphabet[(buffer << (5 - bitsInBuffer)) & 0x1F]); + } + + return builder.ToString(); + } +} 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 7dc5c58110..373870cf99 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt @@ -1 +1,12 @@ #nullable enable +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.AppUserModelId.get -> string? +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ApplicationId.get -> string? +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageFamilyName.get -> string! +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageName.get -> string! +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Publisher.get -> string! +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.ReadFromManifest(System.IO.Stream! manifestStream) -> Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo! +static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ReadFromManifest(string! manifestPath) -> Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo! +static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.TryReadFromLayout(string! layoutDirectory, out Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo? info) -> bool 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 8b6ced3554..bf0d610094 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 @@ -55,4 +55,8 @@ This package extends Microsoft Testing Platform to deploy and launch a packaged + + + + diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index cff90874a8..bf0949b025 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -21,10 +21,15 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// WinUI); see https://github.com/microsoft/testfx/issues/2784. /// /// -/// This reference implementation performs the deploy-and-launch step (stage the loose layout, then -/// launch the produced executable from the deployment directory). The packaged AUMID-activation -/// branch — registering the layout with PackageManager.RegisterPackageByUriAsync and calling -/// IApplicationActivationManager.ActivateApplication — is a clearly-marked follow-up. +/// This reference implementation performs the deploy-and-launch step for a non-packaged +/// (loose-layout) test host (stage the layout, then launch the produced executable from the +/// deployment directory). A genuinely packaged layout — detected by the presence of an +/// AppxManifest.xml — cannot be started with Process.Start; its AUMID-activation branch +/// (registering the layout with PackageManager.RegisterPackageByUriAsync and calling +/// IApplicationActivationManager.ActivateApplication) is a clearly-marked follow-up +/// (https://github.com/microsoft/testfx/issues/2784), so for now such a layout is rejected with an +/// actionable error rather than silently failing at launch. The AUMID that activation will use is +/// already computed from the manifest by . /// /// /// In all cases the platform owns argument/environment preparation, the controller-to-host IPC pipe, @@ -42,7 +47,10 @@ internal sealed class PackagedAppTestHostLauncher : ITestHostLauncher public string Description => ExtensionResources.PackagedAppExtensionDescription; - public Task IsEnabledAsync() => Task.FromResult(true); + // 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()); public Task LaunchTestHostAsync(TestHostLaunchContext context, CancellationToken cancellationToken) { @@ -52,15 +60,28 @@ public Task LaunchTestHostAsync(TestHostLaunchContext context, string sourceDirectory = Path.GetDirectoryName(context.FileName) ?? throw new InvalidOperationException($"Unable to determine the source directory of '{context.FileName}'."); - // 1. Deploy the app's loose layout into an isolated directory. For packaged UWP/WinUI this is - // also where the layout would be registered via PackageManager.RegisterPackageByUriAsync. + // A genuinely packaged (MSIX) app cannot be started with Process.Start: it must be registered + // with the PackageManager and activated by AUMID. That path is not implemented yet (see issue + // #2784), so fail fast with an actionable message — including the AUMID activation would use — + // instead of starting an executable that cannot host the run. + if (AppxManifestInfo.TryReadFromLayout(sourceDirectory, out AppxManifestInfo? manifestInfo)) + { + throw new InvalidOperationException( + string.Format( + CultureInfo.InvariantCulture, + ExtensionResources.PackagedAppLaunchNotSupported, + manifestInfo.AppUserModelId ?? manifestInfo.PackageFamilyName, + Path.Combine(sourceDirectory, AppxManifestInfo.AppxManifestFileName))); + } + + // The layout is not packaged (no AppxManifest.xml). Deploy the loose layout into an isolated + // directory and launch the produced executable from there. + // 1. Copy the app's loose layout into an isolated directory. string deploymentDirectory = Path.Combine(Path.GetTempPath(), "MTPPackagedAppDeployment", Guid.NewGuid().ToString("N")); CopyDirectory(sourceDirectory, deploymentDirectory, cancellationToken); // 2. Launch the deployed test host, forwarding the platform-prepared arguments and // environment (which include the controller IPC pipe name the host connects back on). - // Packaged UWP/WinUI would instead AUMID-activate here via IApplicationActivationManager - // and wrap the activated process id. string deployedFileName = Path.Combine(deploymentDirectory, Path.GetFileName(context.FileName)); var startInfo = new ProcessStartInfo(deployedFileName) { diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx index b7d44974b2..c353fa7e0b 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx @@ -123,4 +123,10 @@ Packaged app test host launcher + + The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element. + + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + 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 a30affb1ae..314c0d8bba 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Nasadí zabaleného hostitele testů Windows (UWP/WinUI) do izolovaného adresáře a spustí ho odtamtud. @@ -12,6 +17,11 @@ Spouštěč hostitele testu zabalené aplikace + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 23f350ab35..8173de28f6 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Stellt einen verpackten Windows-Testhost (UWP/WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. @@ -12,6 +17,11 @@ Testhoststarter für App-Pakete + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 eed340f825..b938996ca3 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Implementa un host de prueba de Windows empaquetado (UWP/WinUI) en un directorio aislado y lo inicia desde allí. @@ -12,6 +17,11 @@ Iniciador de host de prueba de aplicaciones empaquetadas + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 e605030357..352d3de271 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Déploie un hôte de test Windows packagé (UWP/WinUI) dans un répertoire isolé et le lance à partir de cet emplacement. @@ -12,6 +17,11 @@ Lanceur d’hôte de test d’applications packagées + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 c45edcb3fe..8b2698d6d0 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Distribuisce un host di test Windows (UWP/WinUI) in pacchetto in una directory isolata e lo avvia da qui. @@ -12,6 +17,11 @@ Launcher host di test app in pacchetto + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 9c96967e7c..be1b6b61f6 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. パッケージ化された Windows (UWP/WinUI) テスト ホストを分離されたディレクトリに展開し、そこから起動します。 @@ -12,6 +17,11 @@ パッケージ アプリ テスト ホスト ランチャー + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 8b9f6e8bce..3eb0bca2c0 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. 패키지된 Windows(UWP/WinUI) 테스트 호스트를 격리된 디렉터리에 배포하고 해당 디렉터리에서 시작합니다. @@ -12,6 +17,11 @@ 패키지된 앱 테스트 호스트 실행기 + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 2362fbf30f..ee91ca23dc 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Wdraża pakietowego hosta testowego Windows (UWP/WinUI) w odizolowanym katalogu i uruchamia go z tego miejsca. @@ -12,6 +17,11 @@ Uruchamianie pakietowego hosta testowego aplikacji + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 e2142a4f51..b2d11b4c05 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Implanta um host de teste do Windows (UWP/WinUI) empacotado em um diretório isolado e o inicia a partir desse diretório. @@ -12,6 +17,11 @@ Inicializador do host de teste do aplicativo empacotado + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 4d1caf87c2..437ab8d172 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Развертывает упакованный узел тестирования Windows (UWP/WinUI) в изолированном каталоге и запускает его оттуда. @@ -12,6 +17,11 @@ Средство запуска узла тестирования упакованных приложений + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 8b4f9ddd1d..a248d3615a 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Paketlenmiş bir Windows (UWP/WinUI) test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. @@ -12,6 +17,11 @@ Paketlenmiş uygulama test konağı başlatıcısı + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 f61f9ed727..3d676cb8b4 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. 将打包的 Windows (UWP/WinUI)测试主机部署到隔离目录,并从该目录启动它。 @@ -12,6 +17,11 @@ 打包应用测试主机启动器 + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file 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 b94d642f33..d65667328b 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 @@ -2,6 +2,11 @@ + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. 將封裝的 Windows (UWP/WinUI) 測試主機部署到隔離目錄,並從該目錄啟動。 @@ -12,6 +17,11 @@ 封裝應用程式測試主機啟動器 + + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + + \ No newline at end of file diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs new file mode 100644 index 0000000000..22db207844 --- /dev/null +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// The PackagedApp extension only targets .NET (net8.0/net9.0), so these tests are compiled only there. +#if !NETFRAMEWORK + +using Microsoft.Testing.Extensions.PackagedApp; + +namespace Microsoft.Testing.Extensions.UnitTests; + +[TestClass] +public sealed class AppxManifestInfoTests +{ + // The publisher of Microsoft Store apps, whose well-known publisher id is "8wekyb3d8bbwe". + private const string MicrosoftStorePublisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"; + private const string MicrosoftStorePublisherId = "8wekyb3d8bbwe"; + + [TestMethod] + public void ComputePublisherId_ForMicrosoftStorePublisher_MatchesWellKnownHash() + => Assert.AreEqual(MicrosoftStorePublisherId, AppxManifestInfo.ComputePublisherId(MicrosoftStorePublisher)); + + [TestMethod] + public void ComputePublisherId_IsThirteenCharacters() + => Assert.HasCount(13, AppxManifestInfo.ComputePublisherId("CN=Contoso")); + + [TestMethod] + public void ComputePublisherId_IsStableForSameInput() + => Assert.AreEqual( + AppxManifestInfo.ComputePublisherId("CN=Contoso"), + AppxManifestInfo.ComputePublisherId("CN=Contoso")); + + [TestMethod] + public void ComputePublisherId_IsCaseSensitive() + => Assert.AreNotEqual( + AppxManifestInfo.ComputePublisherId("CN=Contoso"), + AppxManifestInfo.ComputePublisherId("CN=contoso")); + + [TestMethod] + public void ReadFromManifest_ComputesPackageFamilyNameAndAppUserModelId() + { + AppxManifestInfo info = ReadManifest( + name: "Contoso.MyTestApp", + publisher: MicrosoftStorePublisher, + applicationId: "App"); + + Assert.AreEqual("Contoso.MyTestApp", info.PackageName); + Assert.AreEqual(MicrosoftStorePublisher, info.Publisher); + Assert.AreEqual("App", info.ApplicationId); + Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", info.PackageFamilyName); + Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", info.AppUserModelId); + } + + [TestMethod] + public void ReadFromManifest_WithoutApplication_LeavesAppUserModelIdNull() + { + AppxManifestInfo info = ReadManifest( + name: "Contoso.MyTestApp", + publisher: MicrosoftStorePublisher, + applicationId: null); + + Assert.IsNull(info.ApplicationId); + Assert.IsNull(info.AppUserModelId); + Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", info.PackageFamilyName); + } + + [TestMethod] + public void ReadFromManifest_IgnoresSchemaNamespaceVersion() + { + // A different foundation-namespace revision must still parse (we match by local name). + const string ManifestXml = """ + + + + + + + + """; + + AppxManifestInfo info = ReadManifest(ManifestXml); + + Assert.AreEqual("Contoso.MyTestApp", info.PackageName); + Assert.AreEqual("App", info.ApplicationId); + } + + [TestMethod] + public void ReadFromManifest_UsesFirstApplicationId() + { + const string ManifestXml = """ + + + + + + + + + """; + + Assert.AreEqual("First", ReadManifest(ManifestXml).ApplicationId); + } + + [TestMethod] + public void ReadFromManifest_WithoutIdentity_Throws() + { + const string ManifestXml = """ + + + + + + + """; + + Assert.ThrowsExactly(() => ReadManifest(ManifestXml)); + } + + [TestMethod] + public void ReadFromManifest_WithoutPublisher_Throws() + { + const string ManifestXml = """ + + + + + """; + + Assert.ThrowsExactly(() => ReadManifest(ManifestXml)); + } + + [TestMethod] + public void TryReadFromLayout_WithoutManifest_ReturnsFalse() + { + string directory = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(directory); + try + { + Assert.IsFalse(AppxManifestInfo.TryReadFromLayout(directory, out AppxManifestInfo? info)); + Assert.IsNull(info); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void TryReadFromLayout_WithManifest_ReturnsParsedInfo() + { + string directory = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(directory); + try + { + File.WriteAllText( + Path.Combine(directory, AppxManifestInfo.AppxManifestFileName), + BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, "App")); + + Assert.IsTrue(AppxManifestInfo.TryReadFromLayout(directory, out AppxManifestInfo? info)); + Assert.IsNotNull(info); + Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", info.AppUserModelId); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + private static AppxManifestInfo ReadManifest(string name, string publisher, string? applicationId) + => ReadManifest(BuildManifestXml(name, publisher, applicationId)); + + private static AppxManifestInfo ReadManifest(string manifestXml) + { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(manifestXml)); + return AppxManifestInfo.ReadFromManifest(stream); + } + + private static string BuildManifestXml(string name, string publisher, string? applicationId) + { + string applications = applicationId is null + ? string.Empty + : $""" + + + + """; + + return $""" + + + + {applications} + + """; + } +} + +#endif diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/Microsoft.Testing.Extensions.UnitTests.csproj b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/Microsoft.Testing.Extensions.UnitTests.csproj index d33fb6ddbf..ef59d3cc40 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/Microsoft.Testing.Extensions.UnitTests.csproj +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/Microsoft.Testing.Extensions.UnitTests.csproj @@ -55,6 +55,9 @@ TargetFramework=netstandard2.0 + + From 1c2ad90af033d2de57a1fa76512ec13d6baac2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 09:47:26 +0200 Subject: [PATCH 2/9] Update .xlf files to be in sync with .resx Regenerated via UpdateXlf. The last localized check-in added translations for 'GlobalTestFixtureShouldBeValidClassLayout' (fr) and 'SlowTestStillRunning' (ru) that XliffTasks rejects (placeholder mismatch), breaking the build with "xlf is out-of-date with resx". UpdateXlf resets those two units to state="new" so the build passes; they will be re-translated on the next localization pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4350f662-0e5d-4e05-b156-1ef619da3b9e --- .../MSTest.Analyzers/xlf/Resources.fr.xlf | 30 +++++++++---------- .../xlf/GitHubActionsResources.ru.xlf | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf index fd6b6efa2a..398d0b548a 100644 --- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf +++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf @@ -563,21 +563,21 @@ The type declaring these methods should also respect the following rules: -The class should be 'public' -The class should be marked with '[TestClass]' (or a derived attribute) -the class should not be generic. - Les méthodes marquées par « [GlobalTestInitialize] » ou « [GlobalTestCleanup] » doivent respecter le schéma suivant pour être valides : -- elle ne peut pas être déclarée dans une classe générique -– elle doit être « public » -– cela devrait être « static ». -– cela ne devrait pas être « async void ». -– il ne doit pas s'agir d'une méthode spéciale (finaliseur, opérateur...). -– elle ne doit pas être générique -– il doit prendre un paramètre de type « TestContext » -– le type de retour doit être « void », « Task » ou « ValueTask ». -{0} -Le type déclarant ces méthodes doit également respecter les règles suivantes : -- le type doit être une classe -- la classe doit être « public » --La classe doit être marquée avec « [TestClass] » (ou un attribut dérivé). -- la classe ne doit pas être générique. + Methods marked with '[GlobalTestInitialize]' or '[GlobalTestCleanup]' should follow the following layout to be valid: +-it can't be declared on a generic class +-it should be 'public' +-it should be 'static' +-it should not be 'async void' +-it should not be a special method (finalizer, operator...). +-it should not be generic +-it should take one parameter of type 'TestContext' +-return type should be 'void', 'Task' or 'ValueTask' + +The type declaring these methods should also respect the following rules: +-The type should be a class +-The class should be 'public' +-The class should be marked with '[TestClass]' (or a derived attribute) +-the class should not be generic. {Locked="[GlobalTestInitialize]"}{Locked="[GlobalTestCleanup]"}{Locked="[TestClass]"}{Locked="TestContext"}{Locked="ValueTask"}{Locked="Task"}{Locked="public"}{Locked="static"}{Locked="void"}{Locked="async void"}{Locked="async"}{Locked="class"} diff --git a/src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ru.xlf index 44bc6fcda0..d1245f2365 100644 --- a/src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/xlf/GitHubActionsResources.ru.xlf @@ -74,7 +74,7 @@ {0} still running after {1}s - {0} все еще выполняется через {0} с + {0} still running after {1}s {0} is the fully qualified test name, {1} is the elapsed seconds. From 2ae16321139259edbda66cc6a329d7cc7b53b1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 10:00:03 +0200 Subject: [PATCH 3/9] Address review: drop throwing Try* probe and add launcher tests Responds to Copilot review feedback on the PackagedApp extension: - Replace TryReadFromLayout (a Try* method that could still throw on parse/IO errors) with GetManifestPath, a truly non-throwing existence probe that returns the manifest path or null; the launcher now does an explicit ReadFromManifest when a packaged layout is detected. - Add PackagedAppTestHostLauncherTests: IsEnabledAsync is enabled only on Windows (runs on both Windows and non-Windows CI legs), and LaunchTestHostAsync fails fast on a packaged layout with an actionable message carrying the computed AUMID (or package family name when no Application is declared). - Update AppxManifestInfoTests to cover GetManifestPath (including that it never parses). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c5c7d634-e822-4475-9312-a9dde92753f6 --- .../AppxManifestInfo.cs | 22 ++--- .../InternalAPI/InternalAPI.Unshipped.txt | 2 +- .../PackagedAppTestHostLauncher.cs | 6 +- .../AppxManifestInfoTests.cs | 19 ++-- .../PackagedAppTestHostLauncherTests.cs | 95 +++++++++++++++++++ 5 files changed, 117 insertions(+), 27 deletions(-) create mode 100644 test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 1e9653a74d..5d34c4563f 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -62,26 +62,20 @@ private AppxManifestInfo(string packageName, string publisher, string? applicati public string? AppUserModelId { get; } /// - /// Reads the manifest at the root of if the directory is a - /// packaged-app layout. + /// Returns the path to the AppxManifest.xml at the root of + /// when the directory is a packaged-app layout. This is a cheap, non-throwing probe: it only tests + /// for the file's existence and never parses it. Callers that need the parsed identity pass the + /// returned path to . /// /// The directory to probe for an AppxManifest.xml. - /// The parsed manifest info when the directory is a packaged-app layout. /// - /// when an AppxManifest.xml was found and parsed; otherwise - /// . + /// The full path to the manifest when the directory is a packaged-app layout; otherwise + /// . /// - public static bool TryReadFromLayout(string layoutDirectory, [NotNullWhen(true)] out AppxManifestInfo? info) + public static string? GetManifestPath(string layoutDirectory) { string manifestPath = Path.Combine(layoutDirectory, AppxManifestFileName); - if (!File.Exists(manifestPath)) - { - info = null; - return false; - } - - info = ReadFromManifest(manifestPath); - return true; + return File.Exists(manifestPath) ? manifestPath : null; } /// Reads and parses the manifest at . 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 373870cf99..9e09b3ced6 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt @@ -7,6 +7,6 @@ Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageName.get -> str Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Publisher.get -> string! 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.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! -static Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.TryReadFromLayout(string! layoutDirectory, out Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo? info) -> bool diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index bf0949b025..9a1beacbe4 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -64,14 +64,16 @@ public Task LaunchTestHostAsync(TestHostLaunchContext context, // with the PackageManager and activated by AUMID. That path is not implemented yet (see issue // #2784), so fail fast with an actionable message — including the AUMID activation would use — // instead of starting an executable that cannot host the run. - if (AppxManifestInfo.TryReadFromLayout(sourceDirectory, out AppxManifestInfo? manifestInfo)) + string? manifestPath = AppxManifestInfo.GetManifestPath(sourceDirectory); + if (manifestPath is not null) { + var manifestInfo = AppxManifestInfo.ReadFromManifest(manifestPath); throw new InvalidOperationException( string.Format( CultureInfo.InvariantCulture, ExtensionResources.PackagedAppLaunchNotSupported, manifestInfo.AppUserModelId ?? manifestInfo.PackageFamilyName, - Path.Combine(sourceDirectory, AppxManifestInfo.AppxManifestFileName))); + manifestPath)); } // The layout is not packaged (no AppxManifest.xml). Deploy the loose layout into an isolated diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs index 22db207844..128e2304b9 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs @@ -129,14 +129,13 @@ public void ReadFromManifest_WithoutPublisher_Throws() } [TestMethod] - public void TryReadFromLayout_WithoutManifest_ReturnsFalse() + public void GetManifestPath_WithoutManifest_ReturnsNull() { string directory = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N")); Directory.CreateDirectory(directory); try { - Assert.IsFalse(AppxManifestInfo.TryReadFromLayout(directory, out AppxManifestInfo? info)); - Assert.IsNull(info); + Assert.IsNull(AppxManifestInfo.GetManifestPath(directory)); } finally { @@ -145,19 +144,19 @@ public void TryReadFromLayout_WithoutManifest_ReturnsFalse() } [TestMethod] - public void TryReadFromLayout_WithManifest_ReturnsParsedInfo() + public void GetManifestPath_WithManifest_ReturnsPathWithoutParsing() { string directory = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N")); Directory.CreateDirectory(directory); try { - File.WriteAllText( - Path.Combine(directory, AppxManifestInfo.AppxManifestFileName), - BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, "App")); + string manifestPath = Path.Combine(directory, AppxManifestInfo.AppxManifestFileName); - Assert.IsTrue(AppxManifestInfo.TryReadFromLayout(directory, out AppxManifestInfo? info)); - Assert.IsNotNull(info); - Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", info.AppUserModelId); + // Intentionally not a valid manifest: GetManifestPath must be a pure existence probe that + // never parses, so an unparsable file must still be reported. + File.WriteAllText(manifestPath, "not xml"); + + Assert.AreEqual(manifestPath, AppxManifestInfo.GetManifestPath(directory)); } finally { diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs new file mode 100644 index 0000000000..15bf458e76 --- /dev/null +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// The PackagedApp extension only targets .NET (net8.0/net9.0), so these tests are compiled only there. +#if !NETFRAMEWORK + +using Microsoft.Testing.Extensions.PackagedApp; +using Microsoft.Testing.Platform.Extensions.TestHostControllers; + +namespace Microsoft.Testing.Extensions.UnitTests; + +[TestClass] +public sealed class PackagedAppTestHostLauncherTests +{ + private const string MicrosoftStorePublisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"; + private const string MicrosoftStorePublisherId = "8wekyb3d8bbwe"; + + [TestMethod] + public async Task IsEnabledAsync_IsEnabledOnlyOnWindows() + { + var launcher = new PackagedAppTestHostLauncher(); + + // Packaged Windows apps are Windows-only. On other operating systems the launcher must report + // itself disabled so it is never registered and the platform is not forced onto the controller + // (deploy-and-launch) host. This assertion runs on both Windows and non-Windows CI legs. + Assert.AreEqual(OperatingSystem.IsWindows(), await launcher.IsEnabledAsync()); + } + + [TestMethod] + public async Task LaunchTestHostAsync_WithPackagedLayout_ThrowsWithApplicationUserModelId() + { + InvalidOperationException exception = await LaunchInLayoutContainingManifestAsync(applicationId: "App"); + + // The error must stay actionable: it carries the AUMID activation would use, so a reader knows + // exactly which packaged app could not be launched. + Assert.Contains($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", exception.Message); + } + + [TestMethod] + public async Task LaunchTestHostAsync_WithPackagedLayoutWithoutApplication_ThrowsWithPackageFamilyName() + { + InvalidOperationException exception = await LaunchInLayoutContainingManifestAsync(applicationId: null); + + // With no Application declared there is no AUMID, so the message falls back to the package + // family name rather than an empty identity. + Assert.Contains($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", exception.Message); + } + + private static async Task LaunchInLayoutContainingManifestAsync(string? applicationId) + { + string directory = Path.Combine(Path.GetTempPath(), "PackagedAppTestHostLauncherTests", Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(directory); + try + { + File.WriteAllText( + Path.Combine(directory, AppxManifestInfo.AppxManifestFileName), + BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, applicationId)); + + var launcher = new PackagedAppTestHostLauncher(); + + // The executable does not need to exist: the packaged-layout check happens before any launch. + string fakeTestHost = Path.Combine(directory, "MyTestApp.exe"); +#pragma warning disable TPEXP // TestHostLaunchContext is experimental. + var context = new TestHostLaunchContext(fakeTestHost, [], new Dictionary(), workingDirectory: null); + return await Assert.ThrowsExactlyAsync( + () => launcher.LaunchTestHostAsync(context, CancellationToken.None)); +#pragma warning restore TPEXP + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + private static string BuildManifestXml(string name, string publisher, string? applicationId) + { + string applications = applicationId is null + ? string.Empty + : $""" + + + + """; + + return $""" + + + + {applications} + + """; + } +} + +#endif From 213236f8e32b5cfa2ac13b3ac3e1b062f43841b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 10:26:10 +0200 Subject: [PATCH 4/9] Add acceptance test for packaged-layout fail-fast Adds PackagedAppLaunchNotSupportedTests, an end-to-end acceptance test that bakes an AppxManifest.xml (Name=Contoso.MyTestApp, Publisher=CN=Contoso, Application Id=App) next to a real Microsoft.Testing.Platform test host that calls AddPackagedAppDeployment(). Running the host exercises the full controller/launch path: the PackagedApp launcher detects the packaged layout and throws instead of Process.Start-ing it. The asset catches the exception and returns a sentinel exit code, so the test deterministically asserts the failure and that the message stays actionable (contains the computed AUMID Contoso.MyTestApp_h91ms92gdsmmt!App and the #2784 tracking URL). The manifest is baked into an immutable per-fixture asset (not mutated at test time), so it is parallel-safe. Windows-only, matching the launcher's OS gating; on other OSes the launcher stays disabled and the layout is never inspected. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c5c7d634-e822-4475-9312-a9dde92753f6 --- .../PackagedAppLaunchNotSupportedTests.cs | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs new file mode 100644 index 0000000000..dfeafd2800 --- /dev/null +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; + +[TestClass] +public sealed class PackagedAppLaunchNotSupportedTests : AcceptanceTestBase +{ + private const string AssetName = "PackagedAppLaunchNotSupportedTest"; + + // The asset's AppxManifest.xml declares Name="Contoso.MyTestApp" Publisher="CN=Contoso" and an + // Application Id="App". The package family name suffix is the deterministic publisher hash of + // "CN=Contoso", so the AUMID the launcher reports is stable and can be asserted verbatim. + private const string ExpectedAppUserModelId = "Contoso.MyTestApp_h91ms92gdsmmt!App"; + private const string TrackingIssueUrl = "https://github.com/microsoft/testfx/issues/2784"; + + // The sentinel exit code the asset returns after catching the launcher's InvalidOperationException. + private const int LaunchNotSupportedExitCode = 3; + + [DynamicData(nameof(TargetFrameworks.NetForDynamicData), typeof(TargetFrameworks))] + [TestMethod] + [OSCondition(ConditionMode.Include, OperatingSystems.Windows, IgnoreMessage = "The launcher is only enabled on Windows; on other operating systems it stays disabled and never inspects the layout.")] + public async Task LaunchTestHost_WithPackagedLayout_FailsFastWithActionableMessage(string currentTfm) + { + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, currentTfm); + + TestHostResult testHostResult = await testHost.ExecuteAsync(cancellationToken: TestContext.CancellationToken); + + // The layout contains an AppxManifest.xml, so the launcher must refuse to Process.Start it and + // instead throw. The asset catches that exception and surfaces it, so the run fails + // deterministically rather than launching a host that cannot host the run. + testHostResult.AssertExitCodeIs(LaunchNotSupportedExitCode); + + // The message must stay actionable: it names the exact packaged app (via its AUMID) that could + // not be launched and points at the tracking issue for the missing activation support. + testHostResult.AssertOutputContains(ExpectedAppUserModelId); + testHostResult.AssertOutputContains(TrackingIssueUrl); + } + + public sealed class TestAssetFixture() : TestAssetFixtureBase() + { + private const string Sources = """ +#file PackagedAppLaunchNotSupportedTest.csproj + + + + $TargetFrameworks$ + Exe + true + enable + preview + + $(NoWarn);TPEXP;NETSDK1201 + + + + + + + + + + + +#file AppxManifest.xml + + + + + + + + + +#file Program.cs +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Testing.Extensions; +using Microsoft.Testing.Platform.Builder; +using Microsoft.Testing.Platform.Capabilities.TestFramework; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Extensions.TestFramework; +using Microsoft.Testing.Platform.Services; + +public class Startup +{ + public static async Task Main(string[] args) + { + var testApplicationBuilder = await TestApplication.CreateBuilderAsync(args); + testApplicationBuilder.RegisterTestFramework(_ => new TestFrameworkCapabilities(), (_,__) => new DummyTestFramework()); + testApplicationBuilder.AddPackagedAppDeployment(); + using ITestApplication app = await testApplicationBuilder.BuildAsync(); + + // The controller process launches the (deployed) test host through the PackagedApp launcher. + // Because an AppxManifest.xml sits next to this app, the launcher throws instead of doing a + // plain Process.Start. Catch it and surface it deterministically so the acceptance test can + // assert on both the exit code and the actionable message. + try + { + return await app.RunAsync(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return 3; + } + } +} + +public class DummyTestFramework : ITestFramework, IDataProducer +{ + public string Uid => nameof(DummyTestFramework); + + public string Version => "2.0.0"; + + public string DisplayName => nameof(DummyTestFramework); + + public string Description => nameof(DummyTestFramework); + + public Task IsEnabledAsync() => Task.FromResult(true); + + public Type[] DataTypesProduced => new[] { typeof(TestNodeUpdateMessage) }; + + public Task CreateTestSessionAsync(CreateTestSessionContext context) + => Task.FromResult(new CreateTestSessionResult() { IsSuccess = true }); + + public Task CloseTestSessionAsync(CloseTestSessionContext context) + => Task.FromResult(new CloseTestSessionResult() { IsSuccess = true }); + + public async Task ExecuteRequestAsync(ExecuteRequestContext context) + { + await context.MessageBus.PublishAsync(this, new TestNodeUpdateMessage(context.Request.Session.SessionUid, new TestNode() + { + Uid = "Test1", + DisplayName = "Test1", + Properties = new PropertyBag(new PassedTestNodeStateProperty()), + })); + + context.Complete(); + } +} +"""; + + public string TargetAssetPath => GetAssetPath(AssetName); + + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, + Sources + .PatchTargetFrameworks(TargetFrameworks.Net) + .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) + .PatchCodeWithReplace("$MicrosoftTestingExtensionsPackagedAppVersion$", MicrosoftTestingExtensionsPackagedAppVersion)); + } + + public TestContext TestContext { get; set; } +} From 5016e788b3a265818d12ebc2c6cd2b4c6a6fb1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 12:16:24 +0200 Subject: [PATCH 5/9] Address PR review: resolve app by executable, honest packaged-app descriptions - AppxManifestInfo now parses all entries and adds ResolveApplication(executableFileName) that disambiguates by executable and rejects ambiguous matches, instead of always selecting the first application. The launcher reports the AUMID of the app matching the requested test host. - Update the extension description, NuGet PackageDescription, and PACKAGE.md to distinguish the supported non-packaged (loose-layout) path from the unsupported packaged (MSIX) path pending #2784; regenerate xlf. - Update InternalAPI and unit tests accordingly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a7e0a98b-132a-4c4d-9d3a-4764c1504e05 --- .../AppxApplicationInfo.cs | 36 ++++++++ .../AppxManifestInfo.cs | 85 +++++++++++++++---- .../InternalAPI/InternalAPI.Unshipped.txt | 9 +- ...soft.Testing.Extensions.PackagedApp.csproj | 2 +- .../PACKAGE.md | 10 +-- .../PackagedAppTestHostLauncher.cs | 7 +- .../Resources/ExtensionResources.resx | 5 +- .../Resources/xlf/ExtensionResources.cs.xlf | 9 +- .../Resources/xlf/ExtensionResources.de.xlf | 9 +- .../Resources/xlf/ExtensionResources.es.xlf | 9 +- .../Resources/xlf/ExtensionResources.fr.xlf | 9 +- .../Resources/xlf/ExtensionResources.it.xlf | 9 +- .../Resources/xlf/ExtensionResources.ja.xlf | 9 +- .../Resources/xlf/ExtensionResources.ko.xlf | 9 +- .../Resources/xlf/ExtensionResources.pl.xlf | 9 +- .../xlf/ExtensionResources.pt-BR.xlf | 9 +- .../Resources/xlf/ExtensionResources.ru.xlf | 9 +- .../Resources/xlf/ExtensionResources.tr.xlf | 9 +- .../xlf/ExtensionResources.zh-Hans.xlf | 9 +- .../xlf/ExtensionResources.zh-Hant.xlf | 9 +- .../AppxManifestInfoTests.cs | 80 ++++++++++++++--- .../PackagedAppTestHostLauncherTests.cs | 32 ++++++- 22 files changed, 318 insertions(+), 65 deletions(-) create mode 100644 src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs new file mode 100644 index 0000000000..abc1bdccb4 --- /dev/null +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace Microsoft.Testing.Extensions.PackagedApp; + +/// +/// A single application declared by a packaged Windows app's AppxManifest.xml +/// (Applications/Application). A package can declare more than one, each with its own +/// Application User Model ID, so the launcher resolves the one matching the requested executable +/// rather than assuming a single application. +/// +internal sealed class AppxApplicationInfo +{ + internal AppxApplicationInfo(string id, string? executable, string appUserModelId) + { + Id = id; + Executable = executable; + AppUserModelId = appUserModelId; + } + + /// Gets the application id (the manifest's Application/@Id). + public string Id { get; } + + /// + /// Gets the application's executable file name (the manifest's Application/@Executable), + /// or when the manifest declares none. Used to disambiguate a package that + /// declares multiple applications by matching the executable the platform asked to launch. + /// + public string? Executable { get; } + + /// + /// Gets the Application User Model ID ({PackageFamilyName}!{Id}) used to activate this + /// application. + /// + public string AppUserModelId { get; } +} diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 5d34c4563f..6e09852ff2 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -31,13 +31,12 @@ internal sealed class AppxManifestInfo // and lowercase letters with i, l, o and u removed). Must not be reordered. private const string PublisherHashAlphabet = "0123456789abcdefghjkmnpqrstvwxyz"; - private AppxManifestInfo(string packageName, string publisher, string? applicationId) + private AppxManifestInfo(string packageName, string publisher, IReadOnlyList applications) { PackageName = packageName; Publisher = publisher; - ApplicationId = applicationId; PackageFamilyName = $"{packageName}_{ComputePublisherId(publisher)}"; - AppUserModelId = applicationId is null ? null : $"{PackageFamilyName}!{applicationId}"; + Applications = applications; } /// Gets the package name (the manifest's Identity/@Name). @@ -46,20 +45,16 @@ private AppxManifestInfo(string packageName, string publisher, string? applicati /// Gets the publisher (the manifest's Identity/@Publisher). public string Publisher { get; } - /// - /// Gets the id of the first application declared in the manifest (Applications/Application/@Id), - /// or when the manifest declares no application. - /// - public string? ApplicationId { get; } - /// Gets the package family name ({PackageName}_{publisherId}). public string PackageFamilyName { get; } /// - /// Gets the Application User Model ID ({PackageFamilyName}!{ApplicationId}) used to activate - /// the app, or when the manifest declares no application. + /// Gets the applications declared by the manifest (Applications/Application), in manifest + /// order. A package can declare several applications, so callers must select the one they want + /// (see ) rather than assuming a single entry. The list + /// is empty when the manifest declares no application. /// - public string? AppUserModelId { get; } + public IReadOnlyList Applications { get; } /// /// Returns the path to the AppxManifest.xml at the root of @@ -106,11 +101,69 @@ public static AppxManifestInfo ReadFromManifest(Stream manifestStream) throw new InvalidOperationException(ExtensionResources.InvalidAppxManifestMissingIdentity); } - string? applicationId = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Applications")? - .Elements().FirstOrDefault(static e => e.Name.LocalName == "Application")? - .Attribute("Id")?.Value; + string packageFamilyName = $"{name}_{ComputePublisherId(publisher)}"; + + // A package may declare several applications, each with its own id (and AUMID). Capture them + // all so the launcher can resolve the one matching the executable it was asked to launch, + // instead of guessing with the first entry. + List applications = root?.Elements().FirstOrDefault(static e => e.Name.LocalName == "Applications")? + .Elements().Where(static e => e.Name.LocalName == "Application") + .Select(application => + { + string? applicationId = application.Attribute("Id")?.Value; + string? executable = application.Attribute("Executable")?.Value; + return applicationId is null || applicationId.Length == 0 + ? null + : new AppxApplicationInfo(applicationId, executable, $"{packageFamilyName}!{applicationId}"); + }) + .Where(static application => application is not null) + .Select(static application => application!) + .ToList() + ?? []; + + return new AppxManifestInfo(name, publisher, applications); + } + + /// + /// 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 + /// disambiguated by matching against each + /// Application/@Executable; an ambiguous request (no match, or several matches) is rejected + /// rather than silently defaulting to the first application, which would identify the wrong app. + /// + /// + /// The file name (not full path) of the executable the platform asked to launch, used to pick the + /// matching application when the manifest declares more than one. + /// + /// + /// The matching application, or when the manifest declares no application. + /// + /// + /// The manifest declares multiple applications and does not + /// match exactly one of them. + /// + public AppxApplicationInfo? ResolveApplication(string? executableFileName) + { + switch (Applications.Count) + { + case 0: + return null; + case 1: + return Applications[0]; + } - return new AppxManifestInfo(name, publisher, applicationId); + AppxApplicationInfo[] matches = [.. Applications.Where(application => + application.Executable is not null + && string.Equals(application.Executable, executableFileName, StringComparison.OrdinalIgnoreCase))]; + + return matches.Length == 1 + ? matches[0] + : throw new InvalidOperationException( + string.Format( + CultureInfo.CurrentCulture, + ExtensionResources.AmbiguousAppxManifestApplication, + executableFileName, + string.Join(", ", Applications.Select(static application => application.AppUserModelId)))); } /// 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 9e09b3ced6..9149a30793 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt @@ -1,10 +1,15 @@ #nullable enable +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.AppUserModelId.get -> string! +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.AppxApplicationInfo(string! id, string? executable, string! appUserModelId) -> void +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.Executable.get -> string? +Microsoft.Testing.Extensions.PackagedApp.AppxApplicationInfo.Id.get -> string! Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo -Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.AppUserModelId.get -> string? -Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ApplicationId.get -> string? +Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Applications.get -> System.Collections.Generic.IReadOnlyList! Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.PackageFamilyName.get -> string! 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? 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.GetManifestPath(string! layoutDirectory) -> 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 bf0d610094..da666ffb55 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 @@ -20,7 +20,7 @@ +This package extends Microsoft Testing Platform to deploy and launch a non-packaged (loose-layout) Windows (UWP/WinUI) test host from an isolated directory instead of starting it in place. Launching a genuinely packaged (MSIX) app by registering its layout with the PackageManager and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784).]]> diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md index 322f0c80ee..b238a53b3a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md @@ -3,12 +3,12 @@ > [!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 a packaged Windows test host (UWP or packaged WinUI) into an isolated directory and launches it from there, instead of starting the test host in place. +`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that deploys a non-packaged (loose-layout) Windows test host (UWP or packaged WinUI project output) into an isolated directory and launches it from there, instead of starting the test host in place. -It is the consumer of the platform's `ITestHostLauncher` extension point for packaged Windows apps. UWP and packaged WinUI ship as MSIX and share the same launch mechanism, which is why VSTest exposes a single `UwpTestHostRuntimeProvider` for both: +It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. UWP and packaged WinUI ship as MSIX and share the same launch mechanism, which is why VSTest exposes a single `UwpTestHostRuntimeProvider` for both: -- **Deploy + launch** (implemented): the app's loose layout is deployed to a deployment directory and the produced executable is launched from there. -- **Packaged AUMID activation** (planned): the loose layout is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#2784](https://github.com/microsoft/testfx/issues/2784). +- **Deploy + launch loose layout** (implemented): a non-packaged (loose-layout) app is deployed to a deployment directory and the produced executable is launched from there. +- **Packaged AUMID activation** (planned): a genuinely packaged (MSIX) layout is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#2784](https://github.com/microsoft/testfx/issues/2784). Until then, a packaged layout is rejected with an actionable error rather than silently failing at launch. 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 +22,7 @@ dotnet add package Microsoft.Testing.Extensions.PackagedApp This package extends Microsoft.Testing.Platform with: -- **Deployment + launch**: stages the packaged Windows (UWP/WinUI) test host payload into an isolated directory and launches the deployed copy. +- **Deployment + launch**: stages the non-packaged (loose-layout) Windows (UWP/WinUI) test host payload into an isolated directory and launches the deployed copy. Genuinely packaged (MSIX) hosts are not launched yet (see [#2784](https://github.com/microsoft/testfx/issues/2784)). - **Mechanism-agnostic monitoring**: returns an `ITestHostHandle` that exposes only the lifecycle the platform needs and no local process id. ## Documentation diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index 9a1beacbe4..f89d48c0e0 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -68,11 +68,16 @@ public Task LaunchTestHostAsync(TestHostLaunchContext context, if (manifestPath is not null) { var manifestInfo = AppxManifestInfo.ReadFromManifest(manifestPath); + + // Resolve the application matching the executable the platform asked to launch so the + // reported identity is the one activation would actually use (a package can declare several + // applications). Fall back to the package family name when the manifest declares none. + AppxApplicationInfo? application = manifestInfo.ResolveApplication(Path.GetFileName(context.FileName)); throw new InvalidOperationException( string.Format( CultureInfo.InvariantCulture, ExtensionResources.PackagedAppLaunchNotSupported, - manifestInfo.AppUserModelId ?? manifestInfo.PackageFamilyName, + application?.AppUserModelId ?? manifestInfo.PackageFamilyName, manifestPath)); } diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx index c353fa7e0b..f98c0ffc62 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx @@ -118,11 +118,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Deploys a packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). Packaged app test host launcher + + The packaged app manifest declares multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + 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 314c0d8bba..41619953e7 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Nasadí zabaleného hostitele testů Windows (UWP/WinUI) do izolovaného adresáře a spustí ho odtamtud. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Nasadí zabaleného hostitele testů Windows (UWP/WinUI) do izolovaného adresáře a spustí ho odtamtud. 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 8173de28f6..fd86998156 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Stellt einen verpackten Windows-Testhost (UWP/WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Stellt einen verpackten Windows-Testhost (UWP/WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. 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 b938996ca3..b95eed9d2f 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Implementa un host de prueba de Windows empaquetado (UWP/WinUI) en un directorio aislado y lo inicia desde allí. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Implementa un host de prueba de Windows empaquetado (UWP/WinUI) en un directorio aislado y lo inicia desde allí. 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 352d3de271..d36fbcc6f6 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Déploie un hôte de test Windows packagé (UWP/WinUI) dans un répertoire isolé et le lance à partir de cet emplacement. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Déploie un hôte de test Windows packagé (UWP/WinUI) dans un répertoire isolé et le lance à partir de cet emplacement. 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 8b2698d6d0..5e1d18b89f 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Distribuisce un host di test Windows (UWP/WinUI) in pacchetto in una directory isolata e lo avvia da qui. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Distribuisce un host di test Windows (UWP/WinUI) in pacchetto in una directory isolata e lo avvia da qui. 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 be1b6b61f6..f96edac8d1 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - パッケージ化された Windows (UWP/WinUI) テスト ホストを分離されたディレクトリに展開し、そこから起動します。 + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + パッケージ化された Windows (UWP/WinUI) テスト ホストを分離されたディレクトリに展開し、そこから起動します。 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 3eb0bca2c0..d6217dbb8a 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - 패키지된 Windows(UWP/WinUI) 테스트 호스트를 격리된 디렉터리에 배포하고 해당 디렉터리에서 시작합니다. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + 패키지된 Windows(UWP/WinUI) 테스트 호스트를 격리된 디렉터리에 배포하고 해당 디렉터리에서 시작합니다. 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 ee91ca23dc..acc17b393f 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Wdraża pakietowego hosta testowego Windows (UWP/WinUI) w odizolowanym katalogu i uruchamia go z tego miejsca. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Wdraża pakietowego hosta testowego Windows (UWP/WinUI) w odizolowanym katalogu i uruchamia go z tego miejsca. 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 b2d11b4c05..8de6a84171 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Implanta um host de teste do Windows (UWP/WinUI) empacotado em um diretório isolado e o inicia a partir desse diretório. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Implanta um host de teste do Windows (UWP/WinUI) empacotado em um diretório isolado e o inicia a partir desse diretório. 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 437ab8d172..6827a93ea8 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Развертывает упакованный узел тестирования Windows (UWP/WinUI) в изолированном каталоге и запускает его оттуда. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Развертывает упакованный узел тестирования Windows (UWP/WinUI) в изолированном каталоге и запускает его оттуда. 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 a248d3615a..6cfc935559 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - Paketlenmiş bir Windows (UWP/WinUI) test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Paketlenmiş bir Windows (UWP/WinUI) test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. 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 3d676cb8b4..049a9c881d 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - 将打包的 Windows (UWP/WinUI)测试主机部署到隔离目录,并从该目录启动它。 + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + 将打包的 Windows (UWP/WinUI)测试主机部署到隔离目录,并从该目录启动它。 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 d65667328b..4abf64b2b9 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 @@ -2,14 +2,19 @@ + + 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 multiple applications and none uniquely matches the executable '{0}'. Candidate Application User Model IDs: {1}. + + 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 packaged Windows (UWP/WinUI) test host to an isolated directory and launches it from there. - 將封裝的 Windows (UWP/WinUI) 測試主機部署到隔離目錄,並從該目錄啟動。 + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + 將封裝的 Windows (UWP/WinUI) 測試主機部署到隔離目錄,並從該目錄啟動。 diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs index 128e2304b9..e9425d362b 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs @@ -45,21 +45,23 @@ public void ReadFromManifest_ComputesPackageFamilyNameAndAppUserModelId() Assert.AreEqual("Contoso.MyTestApp", info.PackageName); Assert.AreEqual(MicrosoftStorePublisher, info.Publisher); - Assert.AreEqual("App", info.ApplicationId); Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", info.PackageFamilyName); - Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", info.AppUserModelId); + + AppxApplicationInfo application = Assert.ContainsSingle(info.Applications); + Assert.AreEqual("App", application.Id); + Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!App", application.AppUserModelId); } [TestMethod] - public void ReadFromManifest_WithoutApplication_LeavesAppUserModelIdNull() + public void ReadFromManifest_WithoutApplication_LeavesApplicationsEmpty() { AppxManifestInfo info = ReadManifest( name: "Contoso.MyTestApp", publisher: MicrosoftStorePublisher, applicationId: null); - Assert.IsNull(info.ApplicationId); - Assert.IsNull(info.AppUserModelId); + Assert.IsEmpty(info.Applications); + Assert.IsNull(info.ResolveApplication("MyTestApp.exe")); Assert.AreEqual($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", info.PackageFamilyName); } @@ -80,24 +82,82 @@ public void ReadFromManifest_IgnoresSchemaNamespaceVersion() AppxManifestInfo info = ReadManifest(ManifestXml); Assert.AreEqual("Contoso.MyTestApp", info.PackageName); - Assert.AreEqual("App", info.ApplicationId); + Assert.AreEqual("App", Assert.ContainsSingle(info.Applications).Id); + } + + [TestMethod] + public void ReadFromManifest_ParsesAllApplicationsInManifestOrder() + { + const string ManifestXml = """ + + + + + + + + + """; + + AppxManifestInfo info = ReadManifest(ManifestXml); + + Assert.HasCount(2, info.Applications); + Assert.AreEqual("First", info.Applications[0].Id); + Assert.AreEqual("First.exe", info.Applications[0].Executable); + Assert.AreEqual("Second", info.Applications[1].Id); + Assert.AreEqual("Second.exe", info.Applications[1].Executable); + } + + [TestMethod] + public void ResolveApplication_WithSingleApplication_ReturnsItRegardlessOfExecutable() + { + AppxManifestInfo info = ReadManifest( + name: "Contoso.MyTestApp", + publisher: MicrosoftStorePublisher, + applicationId: "App"); + + // A single application is unambiguous, so it is returned even when the executable does not match. + Assert.AreEqual("App", info.ResolveApplication("does-not-matter.exe")?.Id); } [TestMethod] - public void ReadFromManifest_UsesFirstApplicationId() + public void ResolveApplication_WithMultipleApplications_SelectsTheOneMatchingTheExecutable() { const string ManifestXml = """ - - + + """; - Assert.AreEqual("First", ReadManifest(ManifestXml).ApplicationId); + AppxManifestInfo info = ReadManifest(ManifestXml); + + // The executable disambiguates: the second application is selected rather than defaulting to the first. + Assert.AreEqual("Second", info.ResolveApplication("Second.exe")?.Id); + } + + [TestMethod] + public void ResolveApplication_WithMultipleApplicationsAndNoMatch_Throws() + { + const string ManifestXml = """ + + + + + + + + + """; + + AppxManifestInfo info = ReadManifest(ManifestXml); + + // An ambiguous request must be rejected instead of silently defaulting to the first application. + Assert.ThrowsExactly(() => info.ResolveApplication("Unknown.exe")); } [TestMethod] diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs index 15bf458e76..0f5714a128 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/PackagedAppTestHostLauncherTests.cs @@ -46,7 +46,33 @@ public async Task LaunchTestHostAsync_WithPackagedLayoutWithoutApplication_Throw Assert.Contains($"Contoso.MyTestApp_{MicrosoftStorePublisherId}", exception.Message); } - private static async Task LaunchInLayoutContainingManifestAsync(string? applicationId) + [TestMethod] + public async Task LaunchTestHostAsync_WithMultipleApplications_ReportsTheOneMatchingTheExecutable() + { + const string ManifestXml = """ + + + + + + + + + """; + + InvalidOperationException exception = await LaunchInLayoutContainingManifestAsync(ManifestXml, testHostFileName: "MyTestApp.exe"); + + // The reported identity must be the app whose Executable matches the requested test host, not + // simply the first application declared in the manifest. + Assert.Contains($"Contoso.MyTestApp_{MicrosoftStorePublisherId}!Second", exception.Message); + } + + private static Task LaunchInLayoutContainingManifestAsync(string? applicationId) + => LaunchInLayoutContainingManifestAsync( + BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, applicationId), + testHostFileName: "MyTestApp.exe"); + + private static async Task LaunchInLayoutContainingManifestAsync(string manifestXml, string testHostFileName) { string directory = Path.Combine(Path.GetTempPath(), "PackagedAppTestHostLauncherTests", Guid.NewGuid().ToString("N")); Directory.CreateDirectory(directory); @@ -54,12 +80,12 @@ private static async Task LaunchInLayoutContainingMan { File.WriteAllText( Path.Combine(directory, AppxManifestInfo.AppxManifestFileName), - BuildManifestXml("Contoso.MyTestApp", MicrosoftStorePublisher, applicationId)); + manifestXml); var launcher = new PackagedAppTestHostLauncher(); // The executable does not need to exist: the packaged-layout check happens before any launch. - string fakeTestHost = Path.Combine(directory, "MyTestApp.exe"); + string fakeTestHost = Path.Combine(directory, testHostFileName); #pragma warning disable TPEXP // TestHostLaunchContext is experimental. var context = new TestHostLaunchContext(fakeTestHost, [], new Dictionary(), workingDirectory: null); return await Assert.ThrowsExactlyAsync( From 785c90691a69f0b54facdc87bfe070e764a86b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 12:23:23 +0200 Subject: [PATCH 6/9] Address second review pass: BOM, honest descriptions, correct tracking issue - Add UTF-8 BOM to the PackagedApp .cs files in the diff to match the repo convention (.editorconfig requires utf-8-bom for *.cs). - Point the packaged-app 'not implemented yet' references to the dedicated tracker #9933 instead of #2784 (which tracks unpackaged WinUI and states MSIX already works). - Update the AddPackagedAppDeployment XML docs to state only non-packaged (loose-layout) hosts are launched today and packaged (MSIX) layouts are rejected. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a7e0a98b-132a-4c4d-9d3a-4764c1504e05 --- .../AppxApplicationInfo.cs | 2 +- .../AppxManifestInfo.cs | 2 +- .../Microsoft.Testing.Extensions.PackagedApp.csproj | 2 +- .../PACKAGE.md | 4 ++-- .../PackagedAppExtensions.cs | 10 ++++++---- .../PackagedAppTestHostLauncher.cs | 8 ++++---- .../Resources/ExtensionResources.resx | 4 ++-- .../Resources/xlf/ExtensionResources.cs.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.de.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.es.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.fr.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.it.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.ja.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.ko.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.pl.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.pt-BR.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.ru.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.tr.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.zh-Hans.xlf | 6 +++--- .../Resources/xlf/ExtensionResources.zh-Hant.xlf | 6 +++--- .../PackagedAppLaunchNotSupportedTests.cs | 4 ++-- .../AppxManifestInfoTests.cs | 2 +- .../PackagedAppTestHostLauncherTests.cs | 2 +- 23 files changed, 60 insertions(+), 58 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs index abc1bdccb4..4d6c89aa1b 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxApplicationInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Testing.Extensions.PackagedApp; diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 6e09852ff2..28618093f6 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Security.Cryptography; 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 da666ffb55..bc9a4f1c2b 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 @@ -20,7 +20,7 @@ +This package extends Microsoft Testing Platform to deploy and launch a non-packaged (loose-layout) Windows (UWP/WinUI) test host from an isolated directory instead of starting it in place. Launching a genuinely packaged (MSIX) app by registering its layout with the PackageManager and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933).]]> diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md index b238a53b3a..456537755f 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md @@ -8,7 +8,7 @@ It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. UWP and packaged WinUI ship as MSIX and share the same launch mechanism, which is why VSTest exposes a single `UwpTestHostRuntimeProvider` for both: - **Deploy + launch loose layout** (implemented): a non-packaged (loose-layout) app is deployed to a deployment directory and the produced executable is launched from there. -- **Packaged AUMID activation** (planned): a genuinely packaged (MSIX) layout is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#2784](https://github.com/microsoft/testfx/issues/2784). Until then, a packaged layout is rejected with an actionable error rather than silently failing at launch. +- **Packaged AUMID activation** (planned): a genuinely packaged (MSIX) layout is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#9933](https://github.com/microsoft/testfx/issues/9933). Until then, a packaged layout is rejected with an actionable error rather than silently failing at launch. 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 +22,7 @@ dotnet add package Microsoft.Testing.Extensions.PackagedApp This package extends Microsoft.Testing.Platform with: -- **Deployment + launch**: stages the non-packaged (loose-layout) Windows (UWP/WinUI) test host payload into an isolated directory and launches the deployed copy. Genuinely packaged (MSIX) hosts are not launched yet (see [#2784](https://github.com/microsoft/testfx/issues/2784)). +- **Deployment + launch**: stages the non-packaged (loose-layout) Windows (UWP/WinUI) test host payload into an isolated directory and launches the deployed copy. Genuinely packaged (MSIX) hosts are not launched yet (see [#9933](https://github.com/microsoft/testfx/issues/9933)). - **Mechanism-agnostic monitoring**: returns an `ITestHostHandle` that exposes only the lifecycle the platform needs and no local process id. ## Documentation diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs index 6581c0c11d..be10b114fe 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Testing.Extensions.PackagedApp; @@ -7,15 +7,17 @@ namespace Microsoft.Testing.Extensions; /// -/// Provides extension methods for adding packaged Windows (UWP/WinUI) test host deployment support +/// Provides extension methods for adding Windows (UWP/WinUI) test host deployment support /// to the test application builder. /// [Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")] public static class PackagedAppExtensions { /// - /// Registers a test host launcher that deploys the packaged Windows (UWP/WinUI) test host into - /// an isolated directory and launches it from there. + /// Registers a test host launcher that deploys a non-packaged (loose-layout) Windows (UWP/WinUI) + /// test host into an isolated directory and launches it from there. Genuinely packaged (MSIX) + /// layouts are not launched yet and are rejected with an actionable error (see + /// https://github.com/microsoft/testfx/issues/9933). /// /// 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 f89d48c0e0..6f04e64ace 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Testing.Extensions.PackagedApp.Resources; @@ -18,7 +18,7 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// launch mechanism: the loose layout is registered with the PackageManager and the app is /// activated by Application User Model ID (AUMID) via IApplicationActivationManager. That /// mechanism is the reason VSTest's UwpTestHostRuntimeProvider exists (it serves both UWP and -/// WinUI); see https://github.com/microsoft/testfx/issues/2784. +/// WinUI); see https://github.com/microsoft/testfx/issues/9933. /// /// /// This reference implementation performs the deploy-and-launch step for a non-packaged @@ -27,7 +27,7 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// AppxManifest.xml — cannot be started with Process.Start; its AUMID-activation branch /// (registering the layout with PackageManager.RegisterPackageByUriAsync and calling /// IApplicationActivationManager.ActivateApplication) is a clearly-marked follow-up -/// (https://github.com/microsoft/testfx/issues/2784), so for now such a layout is rejected with an +/// (https://github.com/microsoft/testfx/issues/9933), so for now such a layout is rejected with an /// actionable error rather than silently failing at launch. The AUMID that activation will use is /// already computed from the manifest by . /// @@ -62,7 +62,7 @@ public Task LaunchTestHostAsync(TestHostLaunchContext context, // A genuinely packaged (MSIX) app cannot be started with Process.Start: it must be registered // with the PackageManager and activated by AUMID. That path is not implemented yet (see issue - // #2784), so fail fast with an actionable message — including the AUMID activation would use — + // #9933), so fail fast with an actionable message — including the AUMID activation would use — // instead of starting an executable that cannot host the run. string? manifestPath = AppxManifestInfo.GetManifestPath(sourceDirectory); if (manifestPath is not null) diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx index f98c0ffc62..b1872af852 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Packaged app test host launcher @@ -130,6 +130,6 @@ The packaged app manifest does not declare a valid <Identity Name="..." Publisher="..." /> element. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 41619953e7..93ff3154ce 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Nasadí zabaleného hostitele testů Windows (UWP/WinUI) do izolovaného adresáře a spustí ho odtamtud. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 fd86998156..eea81ab639 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Stellt einen verpackten Windows-Testhost (UWP/WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 b95eed9d2f..90d77203d5 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Implementa un host de prueba de Windows empaquetado (UWP/WinUI) en un directorio aislado y lo inicia desde allí. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 d36fbcc6f6..f09f81870c 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Déploie un hôte de test Windows packagé (UWP/WinUI) dans un répertoire isolé et le lance à partir de cet emplacement. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 5e1d18b89f..47a0d6b7da 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Distribuisce un host di test Windows (UWP/WinUI) in pacchetto in una directory isolata e lo avvia da qui. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 f96edac8d1..342813f607 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). パッケージ化された Windows (UWP/WinUI) テスト ホストを分離されたディレクトリに展開し、そこから起動します。 @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 d6217dbb8a..19072a2b3a 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 패키지된 Windows(UWP/WinUI) 테스트 호스트를 격리된 디렉터리에 배포하고 해당 디렉터리에서 시작합니다. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 acc17b393f..a32ad74c7d 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Wdraża pakietowego hosta testowego Windows (UWP/WinUI) w odizolowanym katalogu i uruchamia go z tego miejsca. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 8de6a84171..85f4772527 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Implanta um host de teste do Windows (UWP/WinUI) empacotado em um diretório isolado e o inicia a partir desse diretório. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 6827a93ea8..62fe01aea5 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Развертывает упакованный узел тестирования Windows (UWP/WinUI) в изолированном каталоге и запускает его оттуда. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 6cfc935559..580a975ad2 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Paketlenmiş bir Windows (UWP/WinUI) test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 049a9c881d..da1d39e2ac 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 将打包的 Windows (UWP/WinUI)测试主机部署到隔离目录,并从该目录启动它。 @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. 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 4abf64b2b9..7b8288c75f 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/2784). + Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 將封裝的 Windows (UWP/WinUI) 測試主機部署到隔離目錄,並從該目錄啟動。 @@ -23,8 +23,8 @@ - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. - Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/2784). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. + Cannot launch the packaged Windows app '{0}' (found '{1}'). Launching a packaged (MSIX) app requires registering the layout with the PackageManager and activating it by Application User Model ID, which this extension does not implement yet (see https://github.com/microsoft/testfx/issues/9933). Only non-packaged (loose-layout) test hosts can be launched today. diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs index dfeafd2800..450bc42361 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedAppLaunchNotSupportedTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -12,7 +12,7 @@ public sealed class PackagedAppLaunchNotSupportedTests : AcceptanceTestBase Date: Tue, 14 Jul 2026 12:25:30 +0200 Subject: [PATCH 7/9] Correct public XML docs on packaged-app registration hooks Update TestingPlatformBuilderHook and the test host handle summaries to state only non-packaged (loose-layout) hosts are launched today and packaged (MSIX) layouts are rejected (tracked by #9933). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a7e0a98b-132a-4c4d-9d3a-4764c1504e05 --- .../PackagedAppTestHostHandle.cs | 8 ++++---- .../TestingPlatformBuilderHook.cs | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs index beedb00ea5..b61b5f804a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Testing.Platform.Extensions.TestHostControllers; @@ -6,9 +6,9 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// -/// An over a deployed packaged Windows (UWP/WinUI) test host process -/// that deliberately exposes no identifier, modelling a launch where no local, queryable PID is -/// available. +/// An over a deployed non-packaged (loose-layout) Windows (UWP/WinUI) +/// test host process that deliberately exposes no identifier, modelling a launch where no local, +/// queryable PID is available. /// internal sealed class PackagedAppTestHostHandle : ITestHostHandle { diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs index 8490e1da24..b89f83becd 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Testing.Platform.Builder; @@ -6,12 +6,13 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// -/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add packaged Windows (UWP/WinUI) test host deployment support. +/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add non-packaged (loose-layout) Windows (UWP/WinUI) test host deployment support. /// public static class TestingPlatformBuilderHook { /// - /// Adds packaged Windows (UWP/WinUI) test host deployment support to the Testing Platform Builder. + /// Adds non-packaged (loose-layout) Windows (UWP/WinUI) test host deployment support to the Testing Platform Builder. + /// Genuinely packaged (MSIX) layouts are not launched yet and are rejected with an actionable error (see https://github.com/microsoft/testfx/issues/9933). /// /// The test application builder. /// The command line arguments. From 7f34eb355dcfad1d660d4957d83639894a294214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 13:33:05 +0200 Subject: [PATCH 8/9] Detect packaged layout when manifest is at an ancestor package root Application/@Executable in an MSIX manifest can be package-root-relative (e.g. bin\\host.exe), so the manifest may live in a parent of the executable's directory. Add AppxManifestInfo.FindManifestPath, which walks up from the executable's directory to the nearest AppxManifest.xml, and use it in the launcher so such valid layouts are still detected instead of falling through to Process.Start. ResolveApplication now matches on the executable file name so a subdirectory-qualified Executable still resolves. Added unit tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a7e0a98b-132a-4c4d-9d3a-4764c1504e05 --- .../AppxManifestInfo.cs | 40 ++++++++++++- .../InternalAPI/InternalAPI.Unshipped.txt | 1 + .../PackagedAppTestHostLauncher.cs | 6 +- .../AppxManifestInfoTests.cs | 60 +++++++++++++++++++ 4 files changed, 104 insertions(+), 3 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs index 28618093f6..30ad3d37e1 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/AppxManifestInfo.cs @@ -73,6 +73,34 @@ 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. + /// + /// The directory to start searching from (typically the executable's directory). + /// + /// The full path to the nearest AppxManifest.xml at or above ; + /// otherwise . + /// + public static string? FindManifestPath(string startDirectory) + { + for (DirectoryInfo? directory = new(startDirectory); directory is not null; directory = directory.Parent) + { + string? manifestPath = GetManifestPath(directory.FullName); + if (manifestPath is not null) + { + return manifestPath; + } + } + + return null; + } + /// Reads and parses the manifest at . /// The path to an AppxManifest.xml. /// The parsed manifest info. @@ -154,7 +182,7 @@ public static AppxManifestInfo ReadFromManifest(Stream manifestStream) AppxApplicationInfo[] matches = [.. Applications.Where(application => application.Executable is not null - && string.Equals(application.Executable, executableFileName, StringComparison.OrdinalIgnoreCase))]; + && string.Equals(GetExecutableFileName(application.Executable), executableFileName, StringComparison.OrdinalIgnoreCase))]; return matches.Length == 1 ? matches[0] @@ -166,6 +194,16 @@ application.Executable is not null string.Join(", ", Applications.Select(static application => application.AppUserModelId)))); } + // The manifest's Application/@Executable is package-root-relative and may include a subdirectory + // (for example "bin\host.exe"), always with Windows separators. Reduce it to the bare file name so + // it can be matched against the executable file name the platform asked to launch, independently of + // the OS running the parser. + private static string GetExecutableFileName(string executable) + { + int lastSeparator = executable.LastIndexOfAny(['\\', '/']); + return lastSeparator < 0 ? executable : executable[(lastSeparator + 1)..]; + } + /// /// 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 9149a30793..a3f260afba 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/InternalAPI/InternalAPI.Unshipped.txt @@ -12,6 +12,7 @@ Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.Publisher.get -> strin Microsoft.Testing.Extensions.PackagedApp.AppxManifestInfo.ResolveApplication(string? executableFileName) -> 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.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! diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index 6f04e64ace..6a8907f88b 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -63,8 +63,10 @@ public Task LaunchTestHostAsync(TestHostLaunchContext context, // A genuinely packaged (MSIX) app cannot be started with Process.Start: it must be registered // with the PackageManager and activated by AUMID. That path is not implemented yet (see issue // #9933), so fail fast with an actionable message — including the AUMID activation would use — - // instead of starting an executable that cannot host the run. - string? manifestPath = AppxManifestInfo.GetManifestPath(sourceDirectory); + // instead of starting an executable that cannot host the run. 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); if (manifestPath is not null) { var manifestInfo = AppxManifestInfo.ReadFromManifest(manifestPath); diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs index 738c55b7b1..6462b58457 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/AppxManifestInfoTests.cs @@ -224,6 +224,66 @@ public void GetManifestPath_WithManifest_ReturnsPathWithoutParsing() } } + [TestMethod] + public void FindManifestPath_WhenManifestIsInAnAncestorDirectory_ReturnsTheNearestManifest() + { + // Model a valid MSIX layout where the manifest sits at the package root but the executable + // lives in a subdirectory (Application/@Executable = "bin\host.exe"). + string root = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N")); + string executableDirectory = Path.Combine(root, "bin"); + Directory.CreateDirectory(executableDirectory); + try + { + string manifestPath = Path.Combine(root, AppxManifestInfo.AppxManifestFileName); + File.WriteAllText(manifestPath, "not xml"); + + // GetManifestPath only probes the executable's own directory and must miss the ancestor + // manifest, whereas FindManifestPath walks up and locates it. + Assert.IsNull(AppxManifestInfo.GetManifestPath(executableDirectory)); + Assert.AreEqual(manifestPath, AppxManifestInfo.FindManifestPath(executableDirectory)); + } + finally + { + Directory.Delete(root, recursive: true); + } + } + + [TestMethod] + public void FindManifestPath_WithoutAnyManifest_ReturnsNull() + { + string directory = Path.Combine(Path.GetTempPath(), "AppxManifestInfoTests", Guid.NewGuid().ToString("N"), "bin"); + Directory.CreateDirectory(directory); + try + { + Assert.IsNull(AppxManifestInfo.FindManifestPath(directory)); + } + finally + { + Directory.Delete(directory, recursive: true); + } + } + + [TestMethod] + public void ResolveApplication_MatchesExecutableDeclaredWithASubdirectoryPath() + { + // A valid MSIX manifest can declare Executable with a package-relative subdirectory path; the + // platform still asks to launch the bare executable file name, so resolution must match on it. + const string ManifestXml = """ + + + + + + + + + """; + + AppxManifestInfo info = ReadManifest(ManifestXml); + + Assert.AreEqual("Second", info.ResolveApplication("Second.exe")?.Id); + } + private static AppxManifestInfo ReadManifest(string name, string publisher, string? applicationId) => ReadManifest(BuildManifestXml(name, publisher, applicationId)); From 86e986670d95b0e85500d64dfe750acbc780b2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 14 Jul 2026 14:12:18 +0200 Subject: [PATCH 9/9] Drop UWP from the supported non-packaged path descriptions UWP apps always require package identity and an AppxManifest.xml, so they are inherently packaged and are rejected by the launcher today. Only genuinely unpackaged hosts (for example, unpackaged WinUI) use the implemented copy-and-launch path. Update PACKAGE.md, the NuGet PackageDescription, the extension resource description, and the public XML docs (PackagedAppExtensions, TestingPlatformBuilderHook, the launcher, and the handle) so the supported path no longer advertises UWP, while UWP/packaged WinUI stay described as the rejected/planned MSIX path. Regenerated xlf. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a7e0a98b-132a-4c4d-9d3a-4764c1504e05 --- .../Microsoft.Testing.Extensions.PackagedApp.csproj | 2 +- .../PACKAGE.md | 10 +++++----- .../PackagedAppExtensions.cs | 12 ++++++------ .../PackagedAppTestHostHandle.cs | 6 +++--- .../PackagedAppTestHostLauncher.cs | 7 ++++--- .../Resources/ExtensionResources.resx | 2 +- .../Resources/xlf/ExtensionResources.cs.xlf | 2 +- .../Resources/xlf/ExtensionResources.de.xlf | 2 +- .../Resources/xlf/ExtensionResources.es.xlf | 2 +- .../Resources/xlf/ExtensionResources.fr.xlf | 2 +- .../Resources/xlf/ExtensionResources.it.xlf | 2 +- .../Resources/xlf/ExtensionResources.ja.xlf | 2 +- .../Resources/xlf/ExtensionResources.ko.xlf | 2 +- .../Resources/xlf/ExtensionResources.pl.xlf | 2 +- .../Resources/xlf/ExtensionResources.pt-BR.xlf | 2 +- .../Resources/xlf/ExtensionResources.ru.xlf | 2 +- .../Resources/xlf/ExtensionResources.tr.xlf | 2 +- .../Resources/xlf/ExtensionResources.zh-Hans.xlf | 2 +- .../Resources/xlf/ExtensionResources.zh-Hant.xlf | 2 +- .../TestingPlatformBuilderHook.cs | 6 +++--- 20 files changed, 36 insertions(+), 35 deletions(-) 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 bc9a4f1c2b..098726e005 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 @@ -20,7 +20,7 @@ +This package extends Microsoft Testing Platform to deploy and launch a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) from an isolated directory instead of starting it in place. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout with the PackageManager and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933).]]> diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md index 456537755f..30832e2587 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PACKAGE.md @@ -3,12 +3,12 @@ > [!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 a non-packaged (loose-layout) Windows test host (UWP or packaged WinUI project output) into an isolated directory and launches it from there, instead of starting the test host in place. +`Microsoft.Testing.Extensions.PackagedApp` is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that deploys a non-packaged (loose-layout) Windows test host (for example, unpackaged WinUI) into an isolated directory and launches it from there, instead of starting the test host in place. -It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. UWP and packaged WinUI ship as MSIX and share the same launch mechanism, which is why VSTest exposes a single `UwpTestHostRuntimeProvider` for both: +It is the consumer of the platform's `ITestHostLauncher` extension point for Windows test hosts. Packaged Windows apps — UWP and packaged WinUI — require package identity and ship as MSIX; they share a single launch mechanism, which is why VSTest exposes a single `UwpTestHostRuntimeProvider` for them: -- **Deploy + launch loose layout** (implemented): a non-packaged (loose-layout) app is deployed to a deployment directory and the produced executable is launched from there. -- **Packaged AUMID activation** (planned): a genuinely packaged (MSIX) layout is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#9933](https://github.com/microsoft/testfx/issues/9933). Until then, a packaged layout is rejected with an actionable error rather than silently failing at launch. +- **Deploy + launch loose layout** (implemented): 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** (planned): a genuinely packaged (MSIX) layout — UWP or packaged WinUI — is registered with the `PackageManager` and the app is activated by Application User Model ID (AUMID) via `IApplicationActivationManager` — the scenario behind [#9933](https://github.com/microsoft/testfx/issues/9933). Until then, a packaged layout is rejected with an actionable error rather than silently failing at launch. 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 +22,7 @@ dotnet add package Microsoft.Testing.Extensions.PackagedApp This package extends Microsoft.Testing.Platform with: -- **Deployment + launch**: stages the non-packaged (loose-layout) Windows (UWP/WinUI) test host payload into an isolated directory and launches the deployed copy. Genuinely packaged (MSIX) hosts are not launched yet (see [#9933](https://github.com/microsoft/testfx/issues/9933)). +- **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. Genuinely packaged (MSIX) hosts — UWP and packaged WinUI — are not launched yet (see [#9933](https://github.com/microsoft/testfx/issues/9933)). - **Mechanism-agnostic monitoring**: returns an `ITestHostHandle` that exposes only the lifecycle the platform needs and no local process id. ## Documentation diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs index be10b114fe..f088833136 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppExtensions.cs @@ -7,17 +7,17 @@ namespace Microsoft.Testing.Extensions; /// -/// Provides extension methods for adding Windows (UWP/WinUI) test host deployment support -/// to the test application builder. +/// Provides extension methods for adding non-packaged (loose-layout) Windows test host deployment +/// support (for example, unpackaged WinUI) to the test application builder. /// [Experimental("TPEXP", UrlFormat = "https://aka.ms/testingplatform/diagnostics#{0}")] public static class PackagedAppExtensions { /// - /// Registers a test host launcher that deploys a non-packaged (loose-layout) Windows (UWP/WinUI) - /// test host into an isolated directory and launches it from there. Genuinely packaged (MSIX) - /// layouts are not launched yet and are rejected with an actionable error (see - /// https://github.com/microsoft/testfx/issues/9933). + /// Registers a test host launcher that deploys a non-packaged (loose-layout) Windows test host + /// (for example, unpackaged WinUI) into an isolated directory and launches it from there. + /// Genuinely packaged (MSIX) layouts — UWP or packaged WinUI — are not launched yet and are + /// rejected with an actionable error (see https://github.com/microsoft/testfx/issues/9933). /// /// The test application builder. public static void AddPackagedAppDeployment(this ITestApplicationBuilder builder) diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs index b61b5f804a..dc4ed71c55 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostHandle.cs @@ -6,9 +6,9 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// -/// An over a deployed non-packaged (loose-layout) Windows (UWP/WinUI) -/// test host process that deliberately exposes no identifier, modelling a launch where no local, -/// queryable PID is available. +/// An over a deployed non-packaged (loose-layout) Windows test host +/// process (for example, unpackaged WinUI) that deliberately exposes no identifier, modelling a +/// launch where no local, queryable PID is available. /// internal sealed class PackagedAppTestHostHandle : ITestHostHandle { diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs index 6a8907f88b..8381d2162d 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/PackagedAppTestHostLauncher.cs @@ -7,9 +7,10 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// -/// An for packaged Windows test applications (UWP and packaged -/// WinUI): it deploys the test host's loose layout into an isolated directory and launches it from -/// there, instead of starting the test host in place. +/// An for Windows test applications: it deploys a non-packaged +/// (loose-layout) test host (for example, unpackaged WinUI) into an isolated directory and launches +/// it from there, instead of starting the test host in place. Genuinely packaged (MSIX) layouts — +/// UWP or packaged WinUI — are rejected for now (see the remarks). /// /// /// diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx index b1872af852..5500f88864 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/Resources/ExtensionResources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Packaged app test host launcher 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 93ff3154ce..bccfde1ac9 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Nasadí zabaleného hostitele testů Windows (UWP/WinUI) do izolovaného adresáře a spustí ho odtamtud. 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 eea81ab639..fc0247de5c 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Stellt einen verpackten Windows-Testhost (UWP/WinUI) in einem isolierten Verzeichnis bereit und startet ihn von dort aus. 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 90d77203d5..a9fb2a50dc 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Implementa un host de prueba de Windows empaquetado (UWP/WinUI) en un directorio aislado y lo inicia desde allí. 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 f09f81870c..2e8021d1d7 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Déploie un hôte de test Windows packagé (UWP/WinUI) dans un répertoire isolé et le lance à partir de cet emplacement. 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 47a0d6b7da..313a74f8df 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Distribuisce un host di test Windows (UWP/WinUI) in pacchetto in una directory isolata e lo avvia da qui. 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 342813f607..eefb70b066 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). パッケージ化された Windows (UWP/WinUI) テスト ホストを分離されたディレクトリに展開し、そこから起動します。 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 19072a2b3a..74fe748159 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 패키지된 Windows(UWP/WinUI) 테스트 호스트를 격리된 디렉터리에 배포하고 해당 디렉터리에서 시작합니다. 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 a32ad74c7d..a347cc82ac 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Wdraża pakietowego hosta testowego Windows (UWP/WinUI) w odizolowanym katalogu i uruchamia go z tego miejsca. 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 85f4772527..e0148ebe8f 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Implanta um host de teste do Windows (UWP/WinUI) empacotado em um diretório isolado e o inicia a partir desse diretório. 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 62fe01aea5..3338dfcd75 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Развертывает упакованный узел тестирования Windows (UWP/WinUI) в изолированном каталоге и запускает его оттуда. 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 580a975ad2..058f49663e 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). Paketlenmiş bir Windows (UWP/WinUI) test konağını yalıtılmış bir dizine dağıtır ve oradan başlatır. 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 da1d39e2ac..7c9c875b9e 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 将打包的 Windows (UWP/WinUI)测试主机部署到隔离目录,并从该目录启动它。 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 7b8288c75f..9a4e72d532 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 @@ -13,7 +13,7 @@ - Deploys a non-packaged (loose-layout) Windows (UWP/WinUI) test host to an isolated directory and launches it from there. Launching a genuinely packaged (MSIX) app by registering its layout and activating it by Application User Model ID is not implemented yet (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. Launching a genuinely packaged (MSIX) app — UWP or packaged WinUI — by registering its layout and activating it by Application User Model ID is not implemented yet (see https://github.com/microsoft/testfx/issues/9933). 將封裝的 Windows (UWP/WinUI) 測試主機部署到隔離目錄,並從該目錄啟動。 diff --git a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs index b89f83becd..a00612afbc 100644 --- a/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs +++ b/src/Platform/Microsoft.Testing.Extensions.PackagedApp/TestingPlatformBuilderHook.cs @@ -6,13 +6,13 @@ namespace Microsoft.Testing.Extensions.PackagedApp; /// -/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add non-packaged (loose-layout) Windows (UWP/WinUI) test host deployment support. +/// This class is used by Microsoft.Testing.Platform.MSBuild to hook into the Testing Platform Builder to add non-packaged (loose-layout) Windows test host deployment support (for example, unpackaged WinUI). /// public static class TestingPlatformBuilderHook { /// - /// Adds non-packaged (loose-layout) Windows (UWP/WinUI) test host deployment support to the Testing Platform Builder. - /// Genuinely packaged (MSIX) layouts are not launched yet and are rejected with an actionable error (see https://github.com/microsoft/testfx/issues/9933). + /// Adds non-packaged (loose-layout) Windows test host deployment support (for example, unpackaged WinUI) to the Testing Platform Builder. + /// Genuinely packaged (MSIX) layouts — UWP or packaged WinUI — are not launched yet and are rejected with an actionable error (see https://github.com/microsoft/testfx/issues/9933). /// /// The test application builder. /// The command line arguments.