Sitelet https://github.com/microsoft/vstest/commit/5fc0474d7cef168866de9e734e8001caf0552936
Skip to content

Commit 5fc0474

Browse files
nohwndCopilot
andcommitted
Ship net462 SCI (9.0.0.11) next to Common.dll, keep netstandard2.0 (9.0.0.0) in Extensions subfolder
SCI 9.0.11 has an AssemblyVersion split: the net462 build is 9.0.0.11 while netstandard2.0/net8.0/net9.0 are all 9.0.0.0. Common.dll compiled against the net462 facade references 9.0.0.11, so hosts without injected binding redirects (e.g. DTA-style) need the 9.0.0.11 file on disk next to Common.dll. However, net9 acceptance-test processes Assembly.LoadFrom net462 extension DLLs from an Extensions subfolder; if SCI 9.0.0.11 is present there, the CLR refuses the conflicting load because SCI 9.0.0.0 is already loaded from the runtime. Ship both flavors in different folders: - tools/net462/Common7/IDE/Extensions/TestPlatform/System.Collections.Immutable.dll -> 9.0.0.11 (net462) - tools/net462/Common7/IDE/Extensions/TestPlatform/Extensions/System.Collections.Immutable.dll -> 9.0.0.0 (netstandard2.0) - tools/net462/System.Collections.Immutable.dll (Portable package) -> 9.0.0.11 (net462) - tools/net8.0/TestHostNetFramework/System.Collections.Immutable.dll -> 9.0.0.0 (netstandard2.0) Also restore app.config binding redirects newVersion to 9.0.0.11 so testhost/ vstest.console/datacollector resolve SCI cleanly against the 9.0.0.11 file shipped next to them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 73bc009 commit 5fc0474

7 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎src/datacollector/app.config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</dependentAssembly>
2727
<dependentAssembly>
2828
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
29-
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.0" />
29+
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.11" />
3030
</dependentAssembly>
3131
<dependentAssembly>
3232
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

‎src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.csproj‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
<MicrosoftExtensionsFileSystemGlobbing Include="$(PkgMicrosoft_Extensions_FileSystemGlobbing)\lib\netstandard2.0\*" />
8787
<NewtonsoftJson Include="$(PkgNewtonsoft_Json)\lib\netstandard2.0\*" />
8888
<SystemCollectionsImmutable Include="$(PkgSystem_Collections_Immutable)\lib\netstandard2.0\*" />
89+
<!-- See note in Microsoft.TestPlatform.csproj: ship net462 SCI (AV 9.0.0.11) alongside Common.dll
90+
at the package root, while keeping netstandard2.0 (9.0.0.0) in nested Extensions subfolders. -->
91+
<SystemCollectionsImmutableNet462 Include="$(PkgSystem_Collections_Immutable)\lib\net462\System.Collections.Immutable.dll" />
8992
<SystemReflectionMetadata Include="$(PkgSystem_Reflection_Metadata)\lib\netstandard2.0\*" />
9093
<MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*" />
9194
</ItemGroup>
@@ -95,6 +98,7 @@
9598
<Copy SourceFiles="@(MicrosoftExtensionsFileSystemGlobbing)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
9699
<Copy SourceFiles="@(NewtonsoftJson)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
97100
<Copy SourceFiles="@(SystemCollectionsImmutable)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
101+
<Copy SourceFiles="@(SystemCollectionsImmutableNet462)" DestinationFiles="$(OutDir)\SCI_Root\%(Filename)%(Extension)" />
98102
<Copy SourceFiles="@(SystemReflectionMetadata)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
99103
<Copy SourceFiles="@(MicrosoftInternalDia)" DestinationFiles="$(OutDir)\Microsoft.Internal.Dia\%(RecursiveDir)%(Filename)%(Extension)" />
100104
</Target>

‎src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.nuspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<file src="net48\zh-Hant\Microsoft.CodeCoverage.IO.resources.dll" target="tools\net462\zh-Hant\Microsoft.CodeCoverage.IO.dll" />
5252

5353
<file src="net48\Newtonsoft.Json.dll" target="tools\net462\Newtonsoft.Json.dll" />
54-
<file src="net48\System.Collections.Immutable.dll" target="tools\net462\System.Collections.Immutable.dll" />
54+
<file src="net48\SCI_Root\System.Collections.Immutable.dll" target="tools\net462\System.Collections.Immutable.dll" />
5555

5656
<file src="net48\System.Reflection.Metadata.dll" target="tools\net462\System.Reflection.Metadata.dll" />
5757
<file src="net48\System.Memory.dll" target="tools\net462\System.Memory.dll" />

‎src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.csproj‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@
107107
<PackageDepsJsonFiles Include="..\..\Microsoft.TestPlatform.PlatformAbstractions\bin\$(Configuration)\$(TargetFramework)\*.deps.json"></PackageDepsJsonFiles>
108108
<NewtonsoftJsonFiles Include="$(PkgNewtonsoft_Json)\lib\netstandard2.0\*"></NewtonsoftJsonFiles>
109109
<SystemCollectionsImmutableFiles Include="$(PkgSystem_Collections_Immutable)\lib\netstandard2.0\*"></SystemCollectionsImmutableFiles>
110+
<!--
111+
The net462 build of SCI has AssemblyVersion 9.0.0.11, which differs from the other TFMs' 9.0.0.0.
112+
We compile Common.dll and friends against the net462 SCI facade (via the central PackageReference
113+
in Directory.Build.targets), so the net462 flavor of SCI must ship next to them in the package
114+
ROOT (tools/net462/Common7/IDE/Extensions/TestPlatform/) for DTA-style hosts that do not get
115+
binding redirects injected. The netstandard2.0 flavor (9.0.0.0) is still used in the nested
116+
Extensions\ subfolder to avoid conflicting-version loads in .NET 9 acceptance-test processes.
117+
-->
118+
<SystemCollectionsImmutableNet462Files Include="$(PkgSystem_Collections_Immutable)\lib\net462\System.Collections.Immutable.dll"></SystemCollectionsImmutableNet462Files>
110119
<SystemReflectionMetadataFiles Include="$(PkgSystem_Reflection_Metadata)\lib\netstandard2.0\*"></SystemReflectionMetadataFiles>
111120
<MicrosoftInternalDiaFiles Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*"></MicrosoftInternalDiaFiles>
112121
<MicrosoftInternalIntellitraceFiles Include="$(PkgMicrosoft_Internal_Intellitrace)\tools\net451\**\*"></MicrosoftInternalIntellitraceFiles>
@@ -127,6 +136,7 @@
127136
<Copy SourceFiles="@(PlatformAbstractionsDepsJsonFiles)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
128137
<Copy SourceFiles="@(NewtonsoftJsonFiles)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
129138
<Copy SourceFiles="@(SystemCollectionsImmutableFiles)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
139+
<Copy SourceFiles="@(SystemCollectionsImmutableNet462Files)" DestinationFiles="$(OutDir)\SCI_Root\%(Filename)%(Extension)" />
130140
<Copy SourceFiles="@(SystemReflectionMetadataFiles)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
131141
<Copy SourceFiles="@(MicrosoftInternalDiaFiles)" DestinationFiles="$(OutDir)\Microsoft.Internal.Dia\%(RecursiveDir)%(Filename)%(Extension)" />
132142
<Copy SourceFiles="@(MicrosoftInternalIntellitraceFiles)" DestinationFiles="$(OutDir)\Microsoft.Internal.Intellitrace\%(RecursiveDir)%(Filename)%(Extension)" />

‎src/package/Microsoft.TestPlatform/Microsoft.TestPlatform.nuspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
<!-- This is needed by System.Reflection.Metadata and its dependencies. -->
8181
<file src="net48\System.Reflection.Metadata.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Reflection.Metadata.dll" />
82-
<file src="net48\System.Collections.Immutable.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Collections.Immutable.dll" />
82+
<file src="net48\SCI_Root\System.Collections.Immutable.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Collections.Immutable.dll" />
8383
<file src="net48\System.Memory.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Memory.dll" />
8484
<file src="net48\System.Runtime.CompilerServices.Unsafe.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Runtime.CompilerServices.Unsafe.dll" />
8585
<file src="net48\System.Numerics.Vectors.dll" target="tools\net462\Common7\IDE\Extensions\TestPlatform\System.Numerics.Vectors.dll" />

‎src/testhost.x86/app.config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</dependentAssembly>
4040
<dependentAssembly>
4141
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
42-
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.0" />
42+
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.11" />
4343
</dependentAssembly>
4444
<dependentAssembly>
4545
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

‎src/vstest.console/app.config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</dependentAssembly>
3232
<dependentAssembly>
3333
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
34-
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.0" />
34+
<bindingRedirect oldVersion="1.0.0.0-9.0.0.11" newVersion="9.0.0.11" />
3535
</dependentAssembly>
3636
<dependentAssembly>
3737
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

0 commit comments

Comments
 (0)