Skip to content

Microsoft.TestPlatform 18.5.0 net462 Extensions layout ships System.Text.Json without companion dependencies #15739

@quasarea

Description

@quasarea

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:

  1. be shipped alongside it in the effective runtime layout, or
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions