[rel/18.6] Revert #16090 and skip nupkg verifier in .NET product build mode - #16091
Merged
Amaury Levé (Evangelink) merged 2 commits intoJun 3, 2026
Conversation
…s/SCI (microsoft#16090)" This reverts commit 9ebba9a.
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>
Amaury Levé (Evangelink)
merged commit Jun 3, 2026
d01a2fe
into
microsoft:rel/18.6
2 of 5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
src/testhost.x86/app.configandsrc/datacollector/app.configto the NuGet.org-aligned values:System.Runtime.CompilerServices.Unsafe6.0.0.0 → 6.0.3.0System.Memory4.0.1.2 → 4.0.5.0System.Buffers4.0.3.0 → 4.0.5.0System.Collections.Immutable9.0.0.0 → 10.0.0.0_VerifyNuGetPackagesonDotNetBuild != '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):
Root cause: VMR vs internal pipeline ship different DLL bytes
The
contentFiles/any/net10.0/TestHostNetFrameworkfolder ofMicrosoft.TestPlatform.CLIis populated with whateverSystem.*DLLs were resolved during pack. Two different build environments resolve them differently:System.Runtime.CompilerServices.Unsafe 6.1.0etc.)A
bindingRedirectnewVersionmust 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.8andmainalready skip_VerifyNuGetPackageswhenDotNetBuild == '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
build.cmd -c Release -packon rel/18.6 with these contents produces redirects matching the shipped DLLs (the auto-fixer leaves the app.configs alone).verify-nupkgs.ps1.A separate PR will back-port the same VMR skip to rel/18.7 (which also runs the verifier in VMR).