Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove netstandard1.x dependencies #5191

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

MichaelSimons
Copy link
Member

Description

Targeting netstandard1.x is now discouraged with the latest .NET SDK. .NET source-build would like to eliminate netstandard1.x references in order to unblock some infrastructure improvements.

The only netstandard1.x references came from the Microsoft.TestPlatform.CoreUtilities.csproj project. These references were upgraded to eliminate the netstandard1.x references .

Related issue

Related to dotnet/source-build#4482

@@ -17,8 +17,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != '$(NetFrameworkMinimum)' ">
<PackageReference Include="System.Diagnostics.FileVersionInfo" Version="4.3.0" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is very old. Dropping it in order to pick up System.Diagnostics.FileVersionInfo.dll via the implicit netcore app ref.

<PackageReference Include="System.Security.Principal.Windows" Version="4.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not seeing how this condition would ever be true given <TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>. Why can't 5.0 be referenced for all non NetFrameworkMinimum scenarios? This change is needed because there is a package downgrade warning with upgrading Microsoft.Win32.Registry in https://github.com/microsoft/vstest/pull/5191/files#diff-cb0ebd35c90417a3701f998bc4ba8f981bb5fd0c4c0b6f078c722bb73f5f5434R20

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On anything newer than .NET 5, this package shouldn't be referenced anymore as the library got moved inbox.

Not seeing how this condition would ever be true given netstandard2.0;$(NetFrameworkMinimum)

This logic adds the latest and previous .NETCoreApp TFMs to all projects:

<!--
CI source build leg: this needs to build the current and previous source build TFM. Both are
necessary as the output of this leg is used in other CI source build legs. Those could be
targeting NetCurrent or NetPrevious hence we must produce both.
-->
<PropertyGroup Condition=" '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildOrchestrator)' != 'true' ">
<TargetFrameworks>$(NetPrevious);$(NetCurrent)</TargetFrameworks>
</PropertyGroup>
<!--
Source build the product: this is the all up build of the product which needs only NetCurrent
-->
<PropertyGroup Condition=" '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildOrchestrator)' == 'true' ">
<TargetFrameworks>$(NetCurrent)</TargetFrameworks>
</PropertyGroup>

@MichaelSimons
Copy link
Member Author

cc @ViktorHofer

@MichaelSimons
Copy link
Member Author

@nohwnd - Can you review or loop in the right folks to review? TIA

@nohwnd
Copy link
Member

nohwnd commented Sep 3, 2024

I will review, last time I looked at this the build was failing so I was not sure if you will make more changes. :)

@MichaelSimons
Copy link
Member Author

I will review, last time I looked at this the build was failing so I was not sure if you will make more changes. :)

Thanks - It was not clear to me how the test failure was related to these changes. I triggered a re-run and will investigate further if it is still failing. I may need some help.

@nohwnd
Copy link
Member

nohwnd commented Nov 18, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nohwnd
Copy link
Member

nohwnd commented Nov 19, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ViktorHofer
Copy link
Member

ViktorHofer commented Nov 19, 2024

@MichaelSimons I looked at your changes and noticed a few packages are referenced on .NETCoreApp but which shouldn't be referenced at all. I created this patch:

diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj
index cedef35f5..09073c688 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj
@@ -16,12 +16,12 @@
     <Reference Include="Microsoft.CSharp" />
   </ItemGroup>
 
-  <ItemGroup Condition=" '$(TargetFramework)' != '$(NetFrameworkMinimum)' ">
+  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp3.1'">
     <PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" />
   </ItemGroup>
 
-  <ItemGroup>
-    <PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
+  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
+    <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
   </ItemGroup>
 
   <ItemGroup>
diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Microsoft.TestPlatform.Extensions.TrxLogger.csproj b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Microsoft.TestPlatform.Extensions.TrxLogger.csproj
index 8396da2fe..8495cad62 100644
--- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/Microsoft.TestPlatform.Extensions.TrxLogger.csproj
+++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/Microsoft.TestPlatform.Extensions.TrxLogger.csproj
@@ -40,7 +40,7 @@
     <ProjectReference Include="$(RepoRoot)src\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
   </ItemGroup>
 
-  <ItemGroup Condition=" '$(TargetFramework)' != '$(NetFrameworkMinimum)' ">
+  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
     <PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
   </ItemGroup>
 
diff --git a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj
index 9278611cb..3efc66d63 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj
+++ b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj
@@ -32,8 +32,8 @@
     <Reference Include="Microsoft.CSharp" />
   </ItemGroup>
 
-  <ItemGroup>
-    <PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
+  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
+    <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
   </ItemGroup>
 
   <ItemGroup>
diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj
index 5aae32c1c..c99696737 100644
--- a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj
+++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj
@@ -9,16 +9,6 @@
     <NoWarn>$(NoWarn);NU1605</NoWarn>
   </PropertyGroup>
 
-  <ItemGroup Condition=" '$(TargetFramework)' == '$(NetCoreAppMinimum)' ">
-    <PackageReference Include="System.Threading.Thread" Version="4.0.0" />
-    <PackageReference Include="System.Diagnostics.Process" Version="4.1.0" />
-    <PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.0.0" />
-    <PackageReference Include="System.Diagnostics.TraceSource" Version="4.0.0" />
-    <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.0.0" />
-    <PackageReference Include="System.Runtime.Loader" Version="4.0.0" />
-    <PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" />
-  </ItemGroup>
-
   <ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' ">
     <Reference Include="System.Configuration" />
     <Reference Include="System" />
diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Microsoft.TestPlatform.TestHostProvider.csproj b/src/Microsoft.TestPlatform.TestHostProvider/Microsoft.TestPlatform.TestHostProvider.csproj
index 8191a31a2..faa6f6814 100644
--- a/src/Microsoft.TestPlatform.TestHostProvider/Microsoft.TestPlatform.TestHostProvider.csproj
+++ b/src/Microsoft.TestPlatform.TestHostProvider/Microsoft.TestPlatform.TestHostProvider.csproj
@@ -26,7 +26,7 @@
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
     <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
-    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
+    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
   </ItemGroup>
   <ItemGroup>
     <Compile Update="NullableHelpers.cs">
diff --git a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.csproj b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.csproj
index 731242151..ed399f1ce 100644
--- a/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.csproj
+++ b/src/package/Microsoft.TestPlatform.CLI/Microsoft.TestPlatform.CLI.csproj
@@ -61,17 +61,21 @@
 
   <ItemGroup>
     <PackageReference Include="System.ComponentModel.Composition" Version="$(SystemComponentModelCompositionVersion)" GeneratePathProperty="true" />
-    <PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlVersion)" GeneratePathProperty="true" PrivateAssets="Runtime" />
-    <PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" GeneratePathProperty="true" PrivateAssets="All" />
     <PackageReference Include="Microsoft.CodeCoverage.IO" Version="$(MicrosoftCodeCoverageIOVersion)" GeneratePathProperty="true" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
     <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" GeneratePathProperty="true" />
     <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingVersion)" GeneratePathProperty="true" />
     <PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="$(MicrosoftDiagnosticsNETCoreClientVersion)" PrivateAssets="All" GeneratePathProperty="true" />
     <PackageReference Include="Microsoft.Internal.Dia" Version="$(TestPlatformMSDiaVersion)" PrivateAssets="All" GeneratePathProperty="true" Condition="'$(TargetFramework)'=='net472'" />
-    <PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" GeneratePathProperty="true" PrivateAssets="Runtime" />
     <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" GeneratePathProperty="true" Condition="'$(TargetFramework)' != 'net472'" />
   </ItemGroup>
 
+  <!-- Exclude packages that are already inbox in newer .NETCoreApp versions. -->
+  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp' or '$(TargetFramework)' == '$(NetCoreAppMinimum)'">
+    <PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" GeneratePathProperty="true" PrivateAssets="Runtime" />
+    <PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlVersion)" GeneratePathProperty="true" PrivateAssets="Runtime" />
+    <PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" GeneratePathProperty="true" PrivateAssets="All" />
+  </ItemGroup>
+
   <Target Name="CopyFiles" AfterTargets="Build">
     <ItemGroup>
       <MicrosoftCodeCoverageIO Include="$(PkgMicrosoft_CodeCoverage_IO)\lib\netstandard2.0\**\*" />
@@ -82,10 +86,11 @@
       <SystemComponentModelComposition Include="$(PkgSystem_ComponentModel_Composition)\lib\netstandard2.0\**\*" />
       <MicrosoftDiagnosticsNETCoreClient Include="$(PkgMicrosoft_Diagnostics_NETCore_Client)\lib\netstandard2.0\**\*" />
       <MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*" />
-      <SystemSecurityAccessControl Include="$(PkgSystem_Security_AccessControl)\runtimes\win\lib\netcoreapp2.0\*" />
-      <SystemSecurityPrincipalWindowsUnix Include="$(PkgSystem_Security_Principal_Windows)\runtimes\unix\lib\netcoreapp2.1\*" />
-      <SystemSecurityPrincipalWindowsWin Include="$(PkgSystem_Security_Principal_Windows)\runtimes\win\lib\netcoreapp2.1\*" />
-      <MicrosoftWin32Registry Include="$(PkgMicrosoft_Win32_Registry)\runtimes\win\lib\netstandard2.0\*" />
+
+      <SystemSecurityAccessControl Include="$(PkgSystem_Security_AccessControl)\runtimes\win\lib\netcoreapp2.0\*" Condition="'$(PkgSystem_Security_AccessControl)' != ''" />
+      <SystemSecurityPrincipalWindowsUnix Include="$(PkgSystem_Security_Principal_Windows)\runtimes\unix\lib\netcoreapp2.1\*" Condition="'$(PkgSystem_Security_Principal_Windows)' != ''" />
+      <SystemSecurityPrincipalWindowsWin Include="$(PkgSystem_Security_Principal_Windows)\runtimes\win\lib\netcoreapp2.1\*" Condition="'$(PkgSystem_Security_Principal_Windows)' != ''" />
+      <MicrosoftWin32Registry Include="$(PkgMicrosoft_Win32_Registry)\runtimes\win\lib\netstandard2.0\*" Condition="'$(PkgMicrosoft_Win32_Registry)' != ''" />
     </ItemGroup>
 
     <Copy SourceFiles="@(MicrosoftCodeCoverageIO)" DestinationFiles="$(OutDir)\Microsoft.CodeCoverage.IO\%(RecursiveDir)%(Filename)%(Extension)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
@@ -95,10 +100,11 @@
     <Copy SourceFiles="@(SystemComponentModelComposition)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(MicrosoftDiagnosticsNETCoreClient)" DestinationFiles="$(OutDir)\Microsoft.Diagnostics.NETCore.Client\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(MicrosoftInternalDia)" DestinationFiles="$(OutDir)\Microsoft.Internal.Dia\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(SystemSecurityAccessControl)" DestinationFiles="$(OutDir)\runtimes\win\lib\netcoreapp2.0\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(SystemSecurityPrincipalWindowsUnix)" DestinationFiles="$(OutDir)\runtimes\unix\lib\netcoreapp2.1\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(SystemSecurityPrincipalWindowsWin)" DestinationFiles="$(OutDir)\runtimes\win\lib\netcoreapp2.1\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(MicrosoftWin32Registry)" DestinationFiles="$(OutDir)\runtimes\win\lib\netstandard2.0\%(RecursiveDir)%(Filename)%(Extension)" />
+
+    <Copy SourceFiles="@(SystemSecurityAccessControl)" DestinationFiles="$(OutDir)\runtimes\win\lib\netcoreapp2.0\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(SystemSecurityAccessControl)' != ''" />
+    <Copy SourceFiles="@(SystemSecurityPrincipalWindowsUnix)" DestinationFiles="$(OutDir)\runtimes\unix\lib\netcoreapp2.1\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(SystemSecurityPrincipalWindowsUnix)' != ''" />
+    <Copy SourceFiles="@(SystemSecurityPrincipalWindowsWin)" DestinationFiles="$(OutDir)\runtimes\win\lib\netcoreapp2.1\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(SystemSecurityPrincipalWindowsWin)' != ''" />
+    <Copy SourceFiles="@(MicrosoftWin32Registry)" DestinationFiles="$(OutDir)\runtimes\win\lib\netstandard2.0\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(MicrosoftWin32Registry)' != ''" />
   </Target>
 
 </Project>
diff --git a/src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.csproj b/src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.csproj
index 116098d40..3c2c61a3d 100644
--- a/src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.csproj
+++ b/src/package/Microsoft.TestPlatform.Portable/Microsoft.TestPlatform.Portable.csproj
@@ -62,28 +62,34 @@
     <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" GeneratePathProperty="true"/>
     <PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingVersion)" GeneratePathProperty="true"/>
     <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" GeneratePathProperty="true"/>
+    <PackageReference Include="Microsoft.Internal.Dia" Version="$(TestPlatformMSDiaVersion)" PrivateAssets="All" GeneratePathProperty="true" />
+  </ItemGroup>
+
+  <!-- Exclude packages that are already inbox in newer .NETCoreApp versions. -->
+  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
     <PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" GeneratePathProperty="true"/>
     <PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" GeneratePathProperty="true"/>
-    <PackageReference Include="Microsoft.Internal.Dia" Version="$(TestPlatformMSDiaVersion)" PrivateAssets="All" GeneratePathProperty="true" />
   </ItemGroup>
 
   <Target Name="CopyFiles" AfterTargets="Build">
     <ItemGroup>
-      <MicrosoftCodeCoverageIO Include="$(PkgMicrosoft_CodeCoverage_IO)\lib\netstandard2.0\**\*"></MicrosoftCodeCoverageIO>
-      <MicrosoftExtensionsDependencyModel Include="$(PkgMicrosoft_Extensions_DependencyModel)\lib\netstandard2.0\*"></MicrosoftExtensionsDependencyModel>
-      <MicrosoftExtensionsFileSystemGlobbing Include="$(PkgMicrosoft_Extensions_FileSystemGlobbing)\lib\netstandard2.0\*"></MicrosoftExtensionsFileSystemGlobbing>
-      <NewtonsoftJson Include="$(PkgNewtonsoft_Json)\lib\netstandard2.0\*"></NewtonsoftJson>
-      <SystemCollectionsImmutable Include="$(PkgSystem_Collections_Immutable)\lib\netstandard2.0\*"></SystemCollectionsImmutable>
-      <SystemReflectionMetadata Include="$(PkgSystem_Reflection_Metadata)\lib\netstandard2.0\*"></SystemReflectionMetadata>
-      <MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*"></MicrosoftInternalDia>
+      <MicrosoftCodeCoverageIO Include="$(PkgMicrosoft_CodeCoverage_IO)\lib\netstandard2.0\**\*" />
+      <MicrosoftExtensionsDependencyModel Include="$(PkgMicrosoft_Extensions_DependencyModel)\lib\netstandard2.0\*" />
+      <MicrosoftExtensionsFileSystemGlobbing Include="$(PkgMicrosoft_Extensions_FileSystemGlobbing)\lib\netstandard2.0\*" />
+      <NewtonsoftJson Include="$(PkgNewtonsoft_Json)\lib\netstandard2.0\*" />
+      <MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*" />
+
+      <SystemCollectionsImmutable Include="$(PkgSystem_Collections_Immutable)\lib\netstandard2.0\*" Condition="'$(PkgSystem_Collections_Immutable)' != ''" />
+      <SystemReflectionMetadata Include="$(PkgSystem_Reflection_Metadata)\lib\netstandard2.0\*" Condition="'$(PkgSystem_Reflection_Metadata)' != ''" />
     </ItemGroup>
 
     <Copy SourceFiles="@(MicrosoftCodeCoverageIO)" DestinationFiles="$(OutDir)\Microsoft.CodeCoverage.IO\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(MicrosoftExtensionsDependencyModel)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(MicrosoftExtensionsFileSystemGlobbing)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(NewtonsoftJson)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(SystemCollectionsImmutable)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
-    <Copy SourceFiles="@(SystemReflectionMetadata)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" />
     <Copy SourceFiles="@(MicrosoftInternalDia)" DestinationFiles="$(OutDir)\Microsoft.Internal.Dia\%(RecursiveDir)%(Filename)%(Extension)" />
+
+    <Copy SourceFiles="@(SystemCollectionsImmutable)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(SystemCollectionsImmutable)' != ''" />
+    <Copy SourceFiles="@(SystemReflectionMetadata)" DestinationFiles="$(OutDir)\%(RecursiveDir)%(Filename)%(Extension)" Condition="'@(SystemReflectionMetadata)' != ''" />
   </Target>
 </Project>
diff --git a/src/package/Microsoft.TestPlatform.TestHost/Microsoft.TestPlatform.TestHost.csproj b/src/package/Microsoft.TestPlatform.TestHost/Microsoft.TestPlatform.TestHost.csproj
index 356823b26..8fe49c2bf 100644
--- a/src/package/Microsoft.TestPlatform.TestHost/Microsoft.TestPlatform.TestHost.csproj
+++ b/src/package/Microsoft.TestPlatform.TestHost/Microsoft.TestPlatform.TestHost.csproj
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppMinimum);$(NetFrameworkMinimum)</TargetFrameworks>
   </PropertyGroup>
 
   <PropertyGroup>

Would you mind if I push into your branch? The changes build fine locally for me (with -sb and without).

@MichaelSimons
Copy link
Member Author

Would you mind if I push into your branch? The changes build fine locally for me (with -sb and without).

@ViktorHofer - please feel free to push updates. Thanks for helping.

@nohwnd
Copy link
Member

nohwnd commented Nov 20, 2024

fails with

Std Error: Error: An assembly specified in the application dependencies manifest (vstest.console.deps.json) was not found: package: 'Microsoft.Win32.Registry', version: '5.0.0' path: 'lib/netstandard2.0/Microsoft.Win32.Registry.dll'

In case you are also looking at this @ViktorHofer :)

<file src="netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Security.AccessControl.dll" target="contentFiles\any\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0" />
<file src="netcoreapp3.1\runtimes\win\lib\netcoreapp2.1\System.Security.Principal.Windows.dll" target="contentFiles\any\netcoreapp3.1\runtimes\win\lib\netcoreapp2.1" />
<file src="netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.Win32.Registry.dll" target="contentFiles\any\netcoreapp3.1\runtimes\win\lib\netstandard2.0" />
<file src="netcoreapp3.1\Microsoft.Win32.Registry.dll" target="contentFiles\any\netcoreapp3.1\lib\netstandard2.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the missing dll that vstest.console is complaining about, but that change looks very dubious.

@ViktorHofer
Copy link
Member

Will take a look

@nohwnd
Copy link
Member

nohwnd commented Nov 22, 2024

I think the condition for .NETCore not including win32.registry libs is the problem, because that library is in-box only in net5.0 and newer. We got approval on dropping netcoreapp3.1 and net5.0 runtimes from our build (we had them because of VS). so I am doing that, that should make this PR easier, or unnecessary.

@ViktorHofer
Copy link
Member

/azp run microsoft.vstest

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ViktorHofer
Copy link
Member

ViktorHofer commented Dec 9, 2024

Running tests: D:\a_work\1\s\artifacts\bin\Microsoft.TestPlatform.Acceptance.IntegrationTests\Release\net6.0\Microsoft.TestPlatform.Acceptance.IntegrationTests.dll [net6.0|x64]

@nohwnd is it expected that this test library takes 50+ minutes to execute?

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.

3 participants