Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 130 additions & 1 deletion docs/decisions/mstest-adapter-lib-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ Assumptions, not confirmed by the maintainer:
| Package | Ordinary assets | UI payload (not in `lib`) | Selected by |
| --- | --- | --- | --- |
| `MSTest.TestFramework` | `lib/{net462,netstandard2.0,net10.0,net11.0,uap10.0.16299}` | `buildTransitive/net10.0/{uwp,winui}/` (`MSTest.Uwp.dll`, `MSTest.WinUI.dll` with xml, pri and WinUI satellites) | Modern UI projects get compile and runtime assets according to the resolved core framework assets. For classic UWP, NuGet selects `lib/uap10.0.16299` directly. |
| `MSTest.TestAdapter` | `lib/{net462,net10.0,net11.0}` | `buildTransitive/net10.0/ui/` (UI adapter and platform services); `buildTransitive/uap10.0/` (classic UWP adapter, platform services and `_localization` satellites) | `_MSTestComputeUIAdapterSelection` decides; `_MSTestSelectUIAdapterAssets` then swaps the resolved `lib/net10.0` adapter DLLs for the `ui/` build in place after `ResolvePackageAssets` (and the publish equivalent); classic UWP references the `uap10.0` payload directly |
| `MSTest.TestAdapter` | `lib/{net462,net10.0,net11.0,uap10.0.16299}` | `buildTransitive/net10.0/` (UI adapter and platform services) | `_MSTestComputeUIAdapterSelection` decides; `_MSTestSelectUIAdapterAssets` then swaps the resolved `lib/net10.0` adapter DLLs for the `buildTransitive/net10.0` build in place after `ResolvePackageAssets` (and the publish equivalent); for classic UWP, NuGet selects `lib/uap10.0.16299` directly (see [classic UWP lib layout](#classic-uwp-adapter-in-lib-and-flat-ui-payload)) |

Classic UWP has a distinct TFM. Its `lib` group includes `MSTest.Uwp` alongside
the same core framework, type forwarders and satellites as `lib/netstandard2.0`:
Expand Down Expand Up @@ -1648,3 +1648,132 @@ the relevant demonstration. Explicit French was tested through packed
build/publish probes, not an additional native activation case. Linux/Bazel
packs and unrelated application-model cases were not rerun. These local
results do not replace fresh blocking CI checks on the published head.

## Classic UWP adapter in lib and flat UI payload

Date: 2026-11-24

### Request

The maintainer asked to drop the `ui` subfolder from the net10 Windows UI
adapter payload, and to ship the classic UWP adapter directly from `lib`
because `uap10.0` is a real NuGet TFM.

### Decision

- The Windows-specific UWP/WinUI adapter build moves from
`buildTransitive/net10.0/ui/` to `buildTransitive/net10.0/`. The
portable net10 adapter stays in `lib/net10.0`, so these two builds do not
collide. `buildTransitive/common/MSTest.TestAdapter.targets` selects the
flat path through `_MSTestUIAdapterRoot`.
- The classic UWP adapter DLLs and satellites move from the
`buildTransitive/uap10.0` payload to `lib/uap10.0.16299/`, matching
`MSTest.TestFramework`. Only the props, targets and `Parallelize.targets`
remain under `buildTransitive/uap10.0/`.
- The UWP targets drop their explicit `Reference`/`HintPath` items. The
`_AddMSTestUwpRuntimeDependencies` AppX `Content` items still deploy the
adapter DLLs, because SDK-style classic UWP projects do not copy NuGet
runtime assets into the AppX layout. Satellite globs read
`lib/uap10.0.16299/<culture>/`, so the existing culture policy is
unchanged.

### Consequences

- NuGet now produces a `uap10.0.16299` `<references>` group with
`MSTest.TestAdapter.dll` and `MSTestAdapter.PlatformServices.dll`. Classic
UWP projects therefore get a compile reference to the adapter, as net462
and net10 consumers already do. Adapter types are mostly internal, so this
was accepted for consistency. Previously the adapter used a
`Private=false` reference with no compile surface.
- Alternative considered: keep the classic UWP DLLs in a `buildTransitive`
payload or keep satellites under `_localization`. It was rejected because
it keeps a parallel, nonstandard asset location for a TFM that NuGet
already understands.

### Validation

- `.\build.cmd -pack` and `.\eng\verify-nupkgs.ps1 -configuration Debug
-updateBaselines`: only `eng/package-shapes/MSTest.TestAdapter.txt`
changed.
- MSTest acceptance tests run with `TESTFX_RUN_WINDOWS_APP_MODEL_TESTS=1`:
`WindowsApplicationModelPackageTests`, `CoreFrameworkAssemblyTests`,
`ClassicUwpTests` and `SdkTests` (including the classic UWP, Modern UWP
and WinUI composition and satellite cases): 191 passed, 0 failed, including
end-to-end classic UWP MTP runs for the `MSTest`, `MSTest.Sdk` and
`MSTest.TestAdapter` consumers and classic UWP satellite filtering.
- MTP `PackagedWinUITests` built the WinUI consumers against the flat
payload but could not run locally: the native cases need
`TESTFX_DOTNET_10_PATH`, and the controller cases failed to load
`Microsoft.CodeCoverage.Instrumentation.Core` from the unchanged
`Microsoft.Testing.Extensions.PackagedApp.MSBuild` controller layout.
CI must cover them.

### Gap

Non-SDK (`packages.config`) classic UWP projects were not exercised. They
may receive adapter satellites from both NuGet and the culture-policy
`Content` items.

### Non-SDK review follow-up

A non-SDK MSBuild probe using the packed UWP adapter confirmed that
`IsTestApplication=false` leaves both adapter DLLs in
`ReferenceCopyLocalPaths`. The classic UWP targets did not import the existing
non-SDK asset policy. The proposed correction shares that policy with classic
UWP and avoids adding adapter `Content` for non-SDK projects, which already
copy resolved references. It also retains the old explicit-reference behavior
for upgraded `packages.config` projects, which do not automatically acquire
new `lib` references. A synthetic probe is not proof of an AppX layout; real
non-SDK UWP packaging and satellite behavior still require verification.

The four `ClassicUwpNonSdkAssetPolicy_FiltersResolvedAdapterAssets` cases were
independently discovered with `--list-tests` and then run with
`--filter 'FullyQualifiedName~ClassicUwpNonSdkAssetPolicy_FiltersResolvedAdapterAssets'
--report-trx`. The current package passed all four; the identical acceptance
host and tests against an isolated **reconstructed** pre-fix package failed all
four at the asset assertions (no skips). The failures included unfiltered
satellites, adapter content duplicated with copy-local items, and missing
adapter references for the simulated upgrade. The tested shipping package's
SHA-256 was
`C4AECB8312D3D9A8D366D943A3574D3D0B4C6CEDE78D18D0E8427D4F08B930C0`;
the reconstructed control's was
`E8B0224E4504B1695CD3FA4088A8DE3AA49753CBB4038ADD9250E490B68B18B0`.
The broader focused acceptance run passed 32 tests with no skips.

```powershell
# Green: from the repository root, with the repo-local SDK on PATH.
artifacts\bin\MSTest.Acceptance.IntegrationTests\Debug\net12.0\MSTest.Acceptance.IntegrationTests.exe `
--filter 'FullyQualifiedName~ClassicUwpNonSdkAssetPolicy_FiltersResolvedAdapterAssets' `
--report-trx --results-directory artifacts\TestResults\uwp-policy-green3
# Exit 0: 4 passed, 0 failed, 0 skipped.

# Red: $red is the isolated session files\uwp-policy-red directory.
& "$red\artifacts\bin\MSTest.Acceptance.IntegrationTests\Debug\net12.0\MSTest.Acceptance.IntegrationTests.exe" `
--filter 'FullyQualifiedName~ClassicUwpNonSdkAssetPolicy_FiltersResolvedAdapterAssets' `
--report-trx --results-directory "$red\results3"
# Exit 2: 0 passed, 4 failed at asset assertions, 0 skipped.
```

A separate non-SDK UWP `PackageReference` app restored that exact shipping
package into an isolated cache and successfully produced an unsigned native
x64 MSIX with Visual Studio MSBuild and `SatelliteResourceLanguages=fr`.
Its real resolved copy-local items contained both adapter DLLs and only their
two French satellites, with no adapter `Content` items. Separate
`PrepareForBuild;ResolveReferences` runs confirmed that disabling resource
copy leaves only the two main adapter DLLs, and `IsTestApplication=false`
leaves no adapter items. These are build and item-policy checks, not a test
run inside the packaged app. The generated native MSIX contains the compiled
app rather than standalone adapter DLLs; it does not prove runtime satellite
loading. A non-native packaging attempt stopped at the Windows SDK's
framework-injection check. A real `packages.config` AppX upgrade and its
VSTest satellite-duplication behavior remain unverified.

```powershell
# $probe is the session files\uwp-nonsdk-appx directory;
# $msbuild is the Visual Studio 18 Insiders MSBuild.exe.
& $msbuild "$probe\PolicyApp.csproj" /restore /p:Configuration=Debug `
/p:Platform=x64 /p:PlatformTarget=x64 /p:UseDotNetNativeToolchain=true `
/p:SatelliteResourceLanguages=fr /p:GenerateAppxPackageOnBuild=true `
/bl:"$probe\build6.binlog" /v:minimal
# Exit 0; native compilation emitted missing-assembly and runtime-directives warnings.
```
64 changes: 34 additions & 30 deletions eng/package-shapes/MSTest.TestAdapter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,24 @@ build/net462/MSTest.TestAdapter.props
build/net462/MSTest.TestAdapter.targets
build/uap10.0/MSTest.TestAdapter.props
build/uap10.0/MSTest.TestAdapter.targets
buildTransitive/net10.0/MSTest.TestAdapter.AssetPolicy.targets
buildTransitive/net10.0/MSTest.TestAdapter.dll
buildTransitive/net10.0/MSTest.TestAdapter.props
buildTransitive/net10.0/MSTest.TestAdapter.targets
buildTransitive/net10.0/MSTestAdapter.PlatformServices.dll
buildTransitive/net10.0/Parallelize.targets
buildTransitive/net10.0/ui/MSTest.TestAdapter.dll
buildTransitive/net10.0/ui/MSTestAdapter.PlatformServices.dll
buildTransitive/net11.0/MSTest.TestAdapter.AssetPolicy.targets
buildTransitive/net11.0/MSTest.TestAdapter.props
buildTransitive/net11.0/MSTest.TestAdapter.targets
buildTransitive/net11.0/Parallelize.targets
buildTransitive/net462/MSTest.TestAdapter.AssetPolicy.targets
buildTransitive/net462/MSTest.TestAdapter.props
buildTransitive/net462/MSTest.TestAdapter.targets
buildTransitive/net462/Parallelize.targets
buildTransitive/uap10.0/MSTest.TestAdapter.dll
buildTransitive/uap10.0/MSTest.TestAdapter.AssetPolicy.targets
buildTransitive/uap10.0/MSTest.TestAdapter.props
buildTransitive/uap10.0/MSTest.TestAdapter.targets
buildTransitive/uap10.0/MSTestAdapter.PlatformServices.dll
buildTransitive/uap10.0/Parallelize.targets
buildTransitive/uap10.0/_localization/cs/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/cs/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/de/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/de/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/es/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/es/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/fr/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/fr/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/it/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/it/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/ja/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/ja/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/ko/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/ko/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/pl/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/pl/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/pt-BR/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/pt-BR/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/ru/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/ru/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/tr/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/tr/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/zh-Hans/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/zh-Hans/MSTestAdapter.PlatformServices.resources.dll
buildTransitive/uap10.0/_localization/zh-Hant/MSTest.TestAdapter.resources.dll
buildTransitive/uap10.0/_localization/zh-Hant/MSTestAdapter.PlatformServices.resources.dll
lib/net10.0/MSTest.TestAdapter.dll
lib/net10.0/MSTestAdapter.PlatformServices.dll
lib/net10.0/cs/MSTest.TestAdapter.resources.dll
Expand Down Expand Up @@ -140,4 +116,32 @@ lib/net462/zh-Hans/MSTest.TestAdapter.resources.dll
lib/net462/zh-Hans/MSTestAdapter.PlatformServices.resources.dll
lib/net462/zh-Hant/MSTest.TestAdapter.resources.dll
lib/net462/zh-Hant/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/MSTest.TestAdapter.dll
lib/uap10.0.16299/MSTestAdapter.PlatformServices.dll
lib/uap10.0.16299/cs/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/cs/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/de/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/de/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/es/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/es/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/fr/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/fr/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/it/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/it/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/ja/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/ja/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/ko/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/ko/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/pl/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/pl/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/pt-BR/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/pt-BR/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/ru/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/ru/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/tr/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/tr/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/zh-Hans/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/zh-Hans/MSTestAdapter.PlatformServices.resources.dll
lib/uap10.0.16299/zh-Hant/MSTest.TestAdapter.resources.dll
lib/uap10.0.16299/zh-Hant/MSTestAdapter.PlatformServices.resources.dll
package/services/metadata/core-properties/{guid}.psmdcp
Loading
Loading