Fix SCI binding failure in DTA hosts (main)#15724
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Forward-ports the rel/18.5 fix for the System.Collections.Immutable binding mismatch affecting Microsoft.VisualStudio.TestPlatform.Common.dll on .NET Framework hosts without binding redirects (notably Azure DevOps DTA), and adds an acceptance-test regression guard.
Changes:
- Add explicit
System.Collections.ImmutablePackageReferencefor.NETFrameworkbuilds inCoreUtilitiesandObjectModelto force consistent compile-time SCI references. - Add a new
DtaLikeHosttest asset (net472) that simulates DTA-style consumption of the shippedtools/net462layout (no binding redirects). - Add new acceptance tests that run
DtaLikeHostagainst both the nupkgtools/net462/...layout and the extracted V2.CLI VSIX layout.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/TestAssets/DtaLikeHost/Program.cs | Minimal host executable that triggers FastFilter.Builder to force SCI/SRM binding at runtime. |
| test/TestAssets/DtaLikeHost/DtaLikeHost.csproj | Builds the repro host and references shipped Common.dll/ObjectModel.dll from either nupkg tools layout or extracted VSIX layout. |
| test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DistributedTestAgentScenarioTests.cs | New acceptance tests that build/run DtaLikeHost as a regression guard. |
| src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj | Forces SCI version selection for .NETFramework builds via explicit package reference. |
| src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj | Forces SCI version selection for .NETFramework builds via explicit package reference. |
This was referenced Apr 27, 2026
Force .NET Framework product projects to compile against the netstandard2.0 build of System.Collections.Immutable (AssemblyVersion 9.0.0.0) instead of the net462 build (AssemblyVersion 9.0.0.11). SCI 9.0.11 introduced an AV divergence between the two TFMs; the nupkg ships the netstandard2.0 DLL, so compiled metadata must reference 9.0.0.0 for consumers without binding redirects (e.g. Azure DevOps Distributed Test Agent) to avoid FileLoadException. - Directory.Build.targets: ExcludeAssets=compile on SCI PackageReference + explicit Reference to netstandard2.0 DLL for .NET Framework product projects - Extend binding redirect oldVersion to cover 9.0.0.11 - Add DtaLikeHost test asset and acceptance test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nohwnd
force-pushed
the
forward-port-sci-main
branch
from
April 27, 2026 15:36
624e723 to
e6d27b1
Compare
Member
Author
|
wait we need to ship nestanardd, fixing |
Add explicit System.Collections.Immutable PackageReference to CoreUtilities and ObjectModel for non-.NETCoreApp targets (netstandard2.0 + .NETFramework). This ensures all product assemblies compile against SCI 9.0.0.0 (the netstandard2.0 assembly version), matching the SCI DLL shipped in nupkgs. Extend SCI binding redirect oldVersion range to 9.0.0.11 in app.configs to cover the net462 assembly version from SCI 9.0.11. Suppress MSB3277 for .NETCoreApp targets in Directory.Build.targets since the netstandard2.0 SCI 9.0.0.0 reference is harmless on .NET Core (the runtime loads whatever version is available regardless of the reference). Fix MSBuildWarningsAsMessages inheritance in packaging projects that was overwriting parent values instead of appending. Add acceptance test that validates SCI version alignment in nupkg/VSIX layouts using PEReader/MetadataReader. Fixes microsoft#15718 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…i-main # Conflicts: # test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DistributedTestAgentScenarioTests.cs
This was referenced Jul 17, 2026
Open
Open
Open
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.
Fix DTA hosts crashing with
FileLoadExceptiononSystem.Collections.Immutable 8.0.0.0.Why
SCI 9.0.11 has different assembly versions per TFM: net462 gets 9.0.0.11, netstandard2.0 gets 9.0.0.0. Product assemblies (Common.dll etc.) are netstandard2.0 and compile against SCI 8.0.0.0 (from the SRM 8.0.0 transitive dependency). The nupkg ships SCI 9.0.0.0. DTA loads Common.dll without binding redirects, asks for 8.0.0.0, finds 9.0.0.0 — crash.
Changes
MSBuildWarningsAsMessagesinheritance in packaging projects (was overwriting parent values).Fixes #15718
Related PRs: #15722 (rel/18.6), #15723 (rel/18.7)