Skip to content

Fix SCI binding failure in DTA hosts (rel/18.7)#15723

Open
nohwnd wants to merge 8 commits intomicrosoft:rel/18.7from
nohwnd:forward-port-sci-rel-18.7
Open

Fix SCI binding failure in DTA hosts (rel/18.7)#15723
nohwnd wants to merge 8 commits intomicrosoft:rel/18.7from
nohwnd:forward-port-sci-rel-18.7

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Apr 23, 2026

Fix DTA hosts crashing with FileLoadException on System.Collections.Immutable 8.0.0.0.

Same fix as #15724 (main), ported to rel/18.7.

Changes

  • Add explicit SCI PackageReference to CoreUtilities and ObjectModel for non-.NETCoreApp targets. Forces netstandard2.0 product assemblies to compile against SCI 9.0.0.0, matching the shipped DLL.
  • Extend SCI binding redirect range to 9.0.0.11.
  • Suppress MSB3277 for .NETCoreApp targets.
  • Fix MSBuildWarningsAsMessages inheritance in packaging projects.
  • Add acceptance test for SCI version alignment.

Fixes #15718

Related PRs: #15724 (main), #15722 (rel/18.6)

@nohwnd
Copy link
Copy Markdown
Member Author

nohwnd commented Apr 27, 2026

wait we need to ship nestanardd, fixing

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 nohwnd force-pushed the forward-port-sci-rel-18.7 branch from c301be6 to 6756070 Compare April 27, 2026 15:40
Add explicit System.Collections.Immutable PackageReference to CoreUtilities
and ObjectModel for non-.NETCoreApp targets. This ensures product assemblies
compile against SCI 9.0.0.0, matching the shipped DLL.

Extend SCI binding redirect to cover net462 AV 9.0.0.11.
Suppress MSB3277 for .NETCoreApp targets.
Fix MSBuildWarningsAsMessages inheritance in packaging projects.
Fix corrupted XML in app.config files (missing space).
Remove old DtaLikeHost test asset, replace with nupkg-layout test.

Fixes microsoft#15718

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nohwnd nohwnd changed the title Forward-port SCI binding fix to rel/18.7 Fix SCI binding failure in DTA hosts (rel/18.7) Apr 28, 2026
nohwnd and others added 6 commits April 28, 2026 17:43
The previous condition '!= .NETCoreApp' included netstandard2.0, which
made netstandard2.0 assemblies reference SCI 9.0.0.0. This breaks on
.NET 8 where the shared framework only has SCI 8.0.0.0.

Change to '== .NETFramework' so only net462 builds get the explicit SCI
reference (covered by binding redirects), while netstandard2.0 keeps
SCI 8.0.0.0 from the SRM transitive dependency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The DTA scenario (loading SCI without binding redirects) cannot be fully
fixed with SCI 9.0.11 due to assembly version divergence between net462
(9.0.0.11) and netstandard2.0 (9.0.0.0). This will be tracked in a
separate issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SCI 9.0.11 has different assembly versions for net462 (9.0.0.11) vs
netstandard2.0 (9.0.0.0). DTA hosts without binding redirects need
exact version match. SCI 10.0.0 has AV 10.0.0.0 for all TFMs.

- Bump SystemCollectionsImmutableVersion to 10.0.0
- Update binding redirects to 10.0.0.0
- Restore DTA acceptance test with correct DLL name

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SCI 10.0.0 introduces a transitive dependency on System.Memory for net462.
In Release builds, the shipped System.Memory.dll has assembly version 4.0.5.0,
but the MSTest adapter loads against 4.0.1.2. Without a binding redirect in
testhost.x86.exe.config and datacollector.exe.config, the CLR cannot resolve
the version mismatch, causing FileNotFoundException in integration tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
System.Memory 4.6.3 (transitive from SCI 10.0.0) depends on System.Buffers.
In Release builds, System.Buffers.dll has AV 4.0.5.0, but MSTest adapter
loads against 4.0.3.0. Without a redirect, the CLR cannot resolve the mismatch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The redirect was pointing to 6.0.0.11 but the shipped DLL is 6.0.0.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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