Skip to content

[rel/18.6] Revert #16090 and skip nupkg verifier in .NET product build mode - #16091

Merged
Amaury Levé (Evangelink) merged 2 commits into
microsoft:rel/18.6from
Evangelink:dev/amauryleve/fix-vmr-skip-rel186
Jun 3, 2026
Merged

[rel/18.6] Revert #16090 and skip nupkg verifier in .NET product build mode#16091
Amaury Levé (Evangelink) merged 2 commits into
microsoft:rel/18.6from
Evangelink:dev/amauryleve/fix-vmr-skip-rel186

Conversation

@Evangelink

Copy link
Copy Markdown
Member

What

  1. Revert [rel/18.6] Fix stale binding redirects for SCRU/Memory/Buffers/SCI #16090 — restore the binding redirects in src/testhost.x86/app.config and src/datacollector/app.config to the NuGet.org-aligned values:
    • System.Runtime.CompilerServices.Unsafe 6.0.0.0 → 6.0.3.0
    • System.Memory 4.0.1.2 → 4.0.5.0
    • System.Buffers 4.0.3.0 → 4.0.5.0
    • System.Collections.Immutable 9.0.0.0 → 10.0.0.0
  2. Back-port the VMR skip from rel/18.8 / main: gate _VerifyNuGetPackages on DotNetBuild != 'true'.

Why

PR #16090 lowered the binding redirects to match the DLL versions shipped by the dotnet/dotnet VMR build (build 1448463). However, the dnceng internal pipeline (build 2991657) immediately failed with the opposite mismatch — it ships the NuGet.org-resolved DLLs (6.0.3.0/4.0.5.0/4.0.5.0/10.0.0.0):

testhost.x86.exe: System.Runtime.CompilerServices.Unsafe redirect newVersion is '6.0.0.0' but actual assembly version is '6.0.3.0'
testhost.x86.exe: System.Memory redirect newVersion is '4.0.1.2' but actual assembly version is '4.0.5.0'
testhost.x86.exe: System.Buffers redirect newVersion is '4.0.3.0' but actual assembly version is '4.0.5.0'
testhost.x86.exe: System.Collections.Immutable redirect newVersion is '9.0.0.0' but actual assembly version is '10.0.0.0'
(same for datacollector.exe)

Root cause: VMR vs internal pipeline ship different DLL bytes

The contentFiles/any/net10.0/TestHostNetFramework folder of Microsoft.TestPlatform.CLI is populated with whatever System.* DLLs were resolved during pack. Two different build environments resolve them differently:

Build DLL source Shipped AssemblyVersion
dotnet/dotnet VMR (dnceng-public) source-built BCL / runtime 6.0.0.0 / 4.0.1.2 / 4.0.3.0 / 9.0.0.0
dnceng internal & local pack NuGet.org (System.Runtime.CompilerServices.Unsafe 6.1.0 etc.) 6.0.3.0 / 4.0.5.0 / 4.0.5.0 / 10.0.0.0

A bindingRedirect newVersion must equal the AssemblyVersion of the DLL deployed beside the exe — so a single value cannot satisfy both pipelines. The actually-shipped package is the internal-pipeline output, so the redirects must align with NuGet.org versions (which they already did before #16090).

The VMR check is the false positive here. rel/18.8 and main already skip _VerifyNuGetPackages when DotNetBuild == 'true' for exactly this reason (see existing comment on those branches: "source-built dependency packages have different assembly versions than NuGet.org packages... so the binding redirect check produces false positives"). This PR back-ports that same skip to rel/18.6.

Verification

  • Local build.cmd -c Release -pack on rel/18.6 with these contents produces redirects matching the shipped DLLs (the auto-fixer leaves the app.configs alone).
  • After this fix, the internal pipeline verifier passes; the VMR build no longer runs verify-nupkgs.ps1.

A separate PR will back-port the same VMR skip to rel/18.7 (which also runs the verifier in VMR).

Amaury Levé (Evangelink) and others added 2 commits June 3, 2026 23:33
The binding redirect verifier in verify-nupkgs.ps1 fails in the dotnet/dotnet
VMR build because source-built dependency packages have older AssemblyVersion
stamps than NuGet.org packages (e.g. System.Runtime.CompilerServices.Unsafe
ships as 6.0.0.0 from source-build but 6.0.3.0 from NuGet.org).

The newVersion of a bindingRedirect must equal the AssemblyVersion of the
DLL actually shipped beside the exe, so no single value can satisfy both
the VMR/source-build pipeline (dnceng-public) and the internal pipeline
(dnceng / NuGet.org-based) at the same time.

Back-port the same skip already present on rel/18.8 and main: gate the
_VerifyNuGetPackages target on DotNetBuild != 'true' so the VMR no longer
runs the verifier, while the internal pipeline (which produces the actually-
shipped packages) continues to validate the redirects.

This also accompanies the revert of microsoft#16090, which had downgraded the
testhost.x86/datacollector redirects to the VMR-side values and thereby
broke the internal pipeline's verifier check (the shipped DLLs there are
the NuGet.org 6.0.3.0/4.0.5.0/4.0.5.0/10.0.0.0 variants).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Evangelink
Amaury Levé (Evangelink) merged commit d01a2fe into microsoft:rel/18.6 Jun 3, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant