Commit 7789097
Fix SCI binding failure in DTA hosts (rel/18.6) (#15722)
* Fix SCI binding for DTA-like hosts without binding redirects
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>
* Fix SCI binding failure in DTA hosts without binding redirects
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.
Fixes #15718
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove old ExcludeAssets remnant, fix corrupted app.config XML
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix SCI condition to .NETFramework only
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>
* Remove DTA acceptance test
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>
* Bump SCI to 10.0.0 to fix AV divergence
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>
* Add System.Memory binding redirect to testhost.x86, datacollector, and vstest.console
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,
the CLR cannot resolve the version mismatch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add System.Buffers binding redirect and fix System.Text.Json redirect
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.
Also fix System.Text.Json redirect in vstest.console to point to 6.0.0.0
(the actual shipped DLL version) instead of 6.0.0.11.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix TypesToLoadAttributeTests to use custom ALC for dependency resolution
The test loads net462 extension DLLs which reference SCI 10.0.0.0, but the
.NET 8 test host runtime only ships SCI 8.0.0.0. Assembly.LoadFrom cannot
resolve the version mismatch. Use a custom AssemblyLoadContext that resolves
dependencies from the extensions directory.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Unsafe binding redirect version 6.0.0.0 -> 6.0.3.0
The actual System.Runtime.CompilerServices.Unsafe DLL shipped in the
nupkg has assembly version 6.0.3.0 (from SCI 10.0.0 transitive deps),
but the binding redirect was still targeting 6.0.0.0, causing
FileLoadException in testhost and other processes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Retrigger CI - pool may have recovered
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Retrigger CI (pool stalled 24h+)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Retrigger CI (pool stalled 36h+)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use DtaLikeHost exe for SCI binding test, revert ALC hack
Replace the static PE metadata check in DistributedTestAgentScenarioTests
with the original DtaLikeHost approach from rel/18.5: build and run a net472
exe that loads Common.dll without binding redirects.
Update DtaLikeHost.csproj to copy SCI 10.0.0 transitive deps (System.Memory,
System.Buffers, System.Runtime.CompilerServices.Unsafe) alongside the existing
SCI and SRM copies.
Revert the custom AssemblyLoadContext hack from DiscoveryTests.cs — not needed
since SCI resolves correctly from the extensions directory.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Skip TypesToLoadAttributeTests on .NET 9 branches
The test loads net462 extensions via Assembly.LoadFrom in a .NET 9 host.
SCI 10.0.0.0 conflicts with the runtime's 9.0.0.0 — this is not a real
production scenario since vstest.console ships its own SCI in deps.json.
The actual customer scenario (DTA/net48, no binding redirects) is covered
by DistributedTestAgentScenarioTests/DtaLikeHost.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 18d238e commit 7789097
14 files changed
Lines changed: 303 additions & 13 deletions
File tree
- eng
- src
- Microsoft.TestPlatform.CoreUtilities
- Microsoft.TestPlatform.ObjectModel
- datacollector
- package
- Microsoft.TestPlatform.CLI
- Microsoft.TestPlatform.Portable
- Microsoft.TestPlatform
- testhost.x86
- vstest.console
- test
- Microsoft.TestPlatform.Acceptance.IntegrationTests
- TestAssets/DtaLikeHost
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
8 | 19 | | |
9 | 20 | | |
10 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | | - | |
| 39 | + | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | | - | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
0 commit comments