Summary
Microsoft.TestPlatform 18.5.0 installs a net462 VsTest Extensions layout that contains System.Text.Json.dll but not the companion assemblies it depends on for .NET Framework resolution. On hosted Azure DevOps runs using VisualStudioTestPlatformInstaller@1 plus VSTest@2 with code coverage, this causes runtime assembly-load failures unless the missing DLLs are staged manually next to the VsTest extensions.
This looks related to, but different from, #15297. That issue is about Microsoft.CodeCoverage copying System.Text.Json.dll into output/publish layouts. This issue is about the installed VsTest tools\\net462\\...\\Extensions runtime layout itself not being a complete dependency closure.
Repro shape
- Azure DevOps hosted agent (
windows-latest / Windows Server 2025 repro confirmed)
VisualStudioTestPlatformInstaller@1
testPlatformVersion: 18.5.0
VSTest@2
- code coverage enabled
- native / .NET Framework-oriented test execution path that loads the
net462 VsTest extensions
What we observed
The installed TestPlatform package contains:
tools\\net462\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\System.Text.Json.dll
But it does not contain these companion assemblies in the package/runtime layout:
Microsoft.Bcl.AsyncInterfaces.dll
System.Text.Encodings.Web.dll
System.Threading.Tasks.Extensions.dll
We inspected the extracted packages directly:
Microsoft.TestPlatform 18.5.0
System.Text.Json.dll: present
Microsoft.Bcl.AsyncInterfaces.dll: absent
System.Text.Encodings.Web.dll: absent
System.Threading.Tasks.Extensions.dll: absent
Microsoft.CodeCoverage 17.8.0
System.Text.Json.dll: absent
Microsoft.Bcl.AsyncInterfaces.dll: absent
System.Text.Encodings.Web.dll: absent
System.Threading.Tasks.Extensions.dll: absent
Separately, the System.Text.Json 6.0.11 nuspec declares these dependencies for .NETFramework4.6.1:
Microsoft.Bcl.AsyncInterfaces
System.Text.Encodings.Web
System.Threading.Tasks.Extensions
- plus other transitive dependencies
So the problem is not that System.Text.Json has no dependency metadata. The problem is that the VsTest net462 extensions runtime layout is not physically self-contained for this load context on hosted agents.
Workaround
Staging these DLLs next to the installed VsTest extensions fixes the hosted-agent failure for us:
Microsoft.Bcl.AsyncInterfaces.dll (6.0.0, lib\\net461)
System.Text.Encodings.Web.dll (6.0.0, lib\\net461)
System.Threading.Tasks.Extensions.dll (4.5.4, lib\\net461)
into:
VsTest\\18.5.0\\x64\\tools\\net462\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions
We explicitly preserved the VsTest-provided System.Text.Json.dll and only staged the missing companion DLLs.
Why I think this is an upstream packaging/runtime-layout bug
The hosted test run should not require pipeline consumers to reverse-engineer and manually complete the dependency closure for the installed net462 extensions folder. If System.Text.Json.dll is shipped there and loaded from that context, its required companion assemblies should either:
- be shipped alongside it in the effective runtime layout, or
- be resolved through a supported, documented binding/probing mechanism that works on hosted Azure DevOps agents
Right now it appears neither is true for this scenario.
Requested outcome
Please confirm whether this is a known gap in the Microsoft.TestPlatform / coverage extension packaging for the net462 extension path, and whether the fix should be:
- adding the missing companion assemblies to the shipped runtime layout, or
- adding/repairing the binding/probing setup so the extension path resolves them correctly without manual staging
Summary
Microsoft.TestPlatform 18.5.0installs anet462VsTest Extensions layout that containsSystem.Text.Json.dllbut not the companion assemblies it depends on for .NET Framework resolution. On hosted Azure DevOps runs usingVisualStudioTestPlatformInstaller@1plusVSTest@2with code coverage, this causes runtime assembly-load failures unless the missing DLLs are staged manually next to the VsTest extensions.This looks related to, but different from, #15297. That issue is about
Microsoft.CodeCoveragecopyingSystem.Text.Json.dllinto output/publish layouts. This issue is about the installed VsTesttools\\net462\\...\\Extensionsruntime layout itself not being a complete dependency closure.Repro shape
windows-latest/ Windows Server 2025 repro confirmed)VisualStudioTestPlatformInstaller@1testPlatformVersion: 18.5.0VSTest@2net462VsTest extensionsWhat we observed
The installed TestPlatform package contains:
tools\\net462\\Common7\\IDE\\Extensions\\TestPlatform\\Extensions\\System.Text.Json.dllBut it does not contain these companion assemblies in the package/runtime layout:
Microsoft.Bcl.AsyncInterfaces.dllSystem.Text.Encodings.Web.dllSystem.Threading.Tasks.Extensions.dllWe inspected the extracted packages directly:
Microsoft.TestPlatform 18.5.0System.Text.Json.dll: presentMicrosoft.Bcl.AsyncInterfaces.dll: absentSystem.Text.Encodings.Web.dll: absentSystem.Threading.Tasks.Extensions.dll: absentMicrosoft.CodeCoverage 17.8.0System.Text.Json.dll: absentMicrosoft.Bcl.AsyncInterfaces.dll: absentSystem.Text.Encodings.Web.dll: absentSystem.Threading.Tasks.Extensions.dll: absentSeparately, the
System.Text.Json 6.0.11nuspec declares these dependencies for.NETFramework4.6.1:Microsoft.Bcl.AsyncInterfacesSystem.Text.Encodings.WebSystem.Threading.Tasks.ExtensionsSo the problem is not that
System.Text.Jsonhas no dependency metadata. The problem is that the VsTestnet462extensions runtime layout is not physically self-contained for this load context on hosted agents.Workaround
Staging these DLLs next to the installed VsTest extensions fixes the hosted-agent failure for us:
Microsoft.Bcl.AsyncInterfaces.dll(6.0.0,lib\\net461)System.Text.Encodings.Web.dll(6.0.0,lib\\net461)System.Threading.Tasks.Extensions.dll(4.5.4,lib\\net461)into:
VsTest\\18.5.0\\x64\\tools\\net462\\Common7\\IDE\\Extensions\\TestPlatform\\ExtensionsWe explicitly preserved the VsTest-provided
System.Text.Json.dlland only staged the missing companion DLLs.Why I think this is an upstream packaging/runtime-layout bug
The hosted test run should not require pipeline consumers to reverse-engineer and manually complete the dependency closure for the installed
net462extensions folder. IfSystem.Text.Json.dllis shipped there and loaded from that context, its required companion assemblies should either:Right now it appears neither is true for this scenario.
Requested outcome
Please confirm whether this is a known gap in the
Microsoft.TestPlatform/ coverage extension packaging for thenet462extension path, and whether the fix should be: