[rel/18.6] Fix stale binding redirects for SCRU/Memory/Buffers/SCI - #16090
Merged
Amaury Levé (Evangelink) merged 1 commit intoJun 3, 2026
Conversation
The hardened binding-redirect verifier (microsoft#15778) is now catching four stale binding redirects in testhost.x86 and datacollector app.configs. The redirects point at versions that are higher than what actually ships beside the exe in the Microsoft.TestPlatform.CLI nupkg (TestHostNetFramework folder): | Assembly | Redirect | Shipped | |-----------------------------------------|----------|---------| | System.Runtime.CompilerServices.Unsafe | 6.0.3.0 | 6.0.0.0 | | System.Memory | 4.0.5.0 | 4.0.1.2 | | System.Buffers | 4.0.5.0 | 4.0.3.0 | | System.Collections.Immutable | 10.0.0.0 | 9.0.0.0 | These redirects were bumped by the auto-fix script in microsoft#15724 when those higher AV variants were present in the layout at the time, but the rel/18.6 package layout has since reverted to the older transitive versions. A redirect targeting a version that is not actually shipped causes FileLoadException at runtime in hosts without their own binding redirects (e.g. Azure DevOps Distributed Test Agent). Mirrors the auto-fix output of build.cmd -c Release: newVersion and the upper bound of oldVersion are narrowed to the actual shipped DLL version. vstest.console/app.config is intentionally left untouched - vstest.console.exe ships in Microsoft.TestPlatform.NonShipping packages that are not in the verifier's checked set and whose DLL versions are not verified here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Amaury Levé (Evangelink)
merged commit Jun 3, 2026
9ebba9a
into
microsoft:rel/18.6
2 of 5 checks passed
Amaury Levé (Evangelink)
deleted the
dev/amauryleve/fix-unsafe-redirect-rel186
branch
June 3, 2026 21:10
Amaury Levé (Evangelink)
added a commit
that referenced
this pull request
Jun 3, 2026
…d mode (#16091) * Revert "[rel/18.6] Fix stale binding redirects for SCRU/Memory/Buffers/SCI (#16090)" This reverts commit 9ebba9a. * [rel/18.6] Skip nupkg verifier in .NET product build mode 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 #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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
The hardened binding-redirect verifier (#15778, now wired up on rel/18.6 after #16083) is catching four more stale binding redirects in
testhost.x86anddatacollectorapp.configfiles. Each one targets a higher version than what actually ships beside the exe in theMicrosoft.TestPlatform.CLInupkgTestHostNetFrameworkfolder:newVersionSystem.Runtime.CompilerServices.UnsafeSystem.MemorySystem.BuffersSystem.Collections.ImmutableThese four were bumped by the auto-fix in #15724 when the layout contained the newer AVs, but the rel/18.6 package layout has since reverted to the older transitive versions. A redirect pointing at a version that is not shipped causes
FileLoadExceptionin hosts without their own binding redirects (e.g. Azure DevOps Distributed Test Agent — same anti-pattern as #15776 and #16083).This PR mirrors what
build.cmd -c Releasewould produce locally viaeng/verify-binding-redirects.ps1auto-fix: narrows bothnewVersionand the upper bound ofoldVersionto the actual shipped DLL version, for bothsrc/testhost.x86/app.configandsrc/datacollector/app.config.src/vstest.console/app.configis intentionally left untouched —vstest.console.exeships only inMicrosoft.TestPlatform(NonShipping) packages, which are not in the verifier's checked set, so it can't be auto-fixed without risk to a layout we don't validate.Failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1448463