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
14 changes: 7 additions & 7 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<!-- Caused by dependency on System.ComponentModel.Composition.4.5.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="Microsoft.NETCore.Platforms/2.0.0" />
<!-- This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.ComponentModel.Composition/4.5.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.4.5.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.AccessControl/4.5.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.4.5.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.Permissions/4.5.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.4.5.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.Principal.Windows/4.5.0" />
<UsagePattern IdentityGlob="System.ComponentModel.Composition/5.0.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.5.0.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.AccessControl/5.0.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.5.0.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.Permissions/5.0.0" />
<!-- Caused by dependency on System.ComponentModel.Composition.5.0.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.Principal.Windows/5.0.0" />
<UsagePattern IdentityGlob="Microsoft.Diagnostics.NETCore.Client/0.2.452401" />
<!-- Caused by multi-targeting source build for repo builds/CI. Product source build only targets NetCurrent. -->
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/8.0.*" />
Expand Down
6 changes: 3 additions & 3 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Necessary for source-build. This allows the live version of the package to be used by source-build. -->
<Dependency Name="System.ComponentModel.Composition" Version="4.5.0">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>30ab651fcb4354552bd4891619a0bdd81e0ebdbf</Sha>
<Dependency Name="System.ComponentModel.Composition" Version="5.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>cf258a14b70ad9069470a108f13765e0e5988f51</Sha>
</Dependency>
<!-- Necessary for source-build. This allows the live version of the package to be used by source-build. -->
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="3.0.0">
Expand Down
13 changes: 9 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<UsingToolXliff>true</UsingToolXliff>
<!-- Opt-in to Arcade tools for building VSIX projects. -->
<UsingToolVSSDK>true</UsingToolVSSDK>
<!-- Prohibit the usage of .NET Standard 1.x dependencies. -->
<FlagNetStandard1XDependencies Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</FlagNetStandard1XDependencies>
</PropertyGroup>
<PropertyGroup Label="VSTest dependencies">
<CoverletCoverageVersion>1.2.0</CoverletCoverageVersion>
Expand Down Expand Up @@ -51,13 +53,16 @@
<MicrosoftVSTelemetryVersion>17.6.46</MicrosoftVSTelemetryVersion>
<MicrosoftVSUtilitiesInternalVersion>16.3.42</MicrosoftVSUtilitiesInternalVersion>
<MicrosoftVSSDKBuildToolsVersion>17.4.2124</MicrosoftVSSDKBuildToolsVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<NewtonsoftJsonVersion Condition="'$(DotNetBuildSourceOnly)' == 'true'">13.0.3</NewtonsoftJsonVersion>
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion>
<SystemComponentModelCompositionVersion>4.5.0</SystemComponentModelCompositionVersion>
<SystemCollectionsImmutableVersion>5.0.0</SystemCollectionsImmutableVersion>
<SystemComponentModelCompositionVersion>5.0.0</SystemComponentModelCompositionVersion>
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
<SystemNetHttpVersion>4.3.4</SystemNetHttpVersion>
<SystemReflectionMetadataVersion>1.6.0</SystemReflectionMetadataVersion>
<SystemReflectionMetadataVersion>5.0.0</SystemReflectionMetadataVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>5.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemSecurityAccessControlVersion>5.0.0</SystemSecurityAccessControlVersion>
<SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>
<SystemUriVersion>4.3.2</SystemUriVersion>
<TestPlatformExternalsVersion>17.10.0-preview-2-34602-162</TestPlatformExternalsVersion>
<MicrosoftInternalTestPlatformExtensions>17.10.0-preview-2-34602-162</MicrosoftInternalTestPlatformExtensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
<Reference Include="Microsoft.CSharp" />
</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="Microsoft.Win32.Registry" Version="4.0.0" />
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@
<ProjectReference Include="$(RepoRoot)src\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<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>

<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

<dependencies>
<group targetFramework="net462">
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="System.Reflection.Metadata" version="[5.0.0, )" />
</group>

<group targetFramework="netcoreapp3.1">
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="System.Reflection.Metadata" version="[5.0.0, )" />
</group>

<group targetFramework="netstandard2.0">
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="System.Reflection.Metadata" version="[5.0.0, )" />
</group>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="$(SystemRuntimeCompilerServicesUnsafeVersion)" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>
<ItemGroup>
<Compile Update="NullableHelpers.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@

<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>
<MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\netstandard\**\*"></MicrosoftInternalDia>
<SystemComponentModelComposition Include="$(PkgSystem_ComponentModel_Composition)\lib\netstandard2.0\**\*"></SystemComponentModelComposition>
<MicrosoftDiagnosticsNETCoreClient Include="$(PkgMicrosoft_Diagnostics_NETCore_Client)\lib\netstandard2.0\**\*"></MicrosoftDiagnosticsNETCoreClient>
<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\netstandard\**\*" />
<SystemComponentModelComposition Include="$(PkgSystem_ComponentModel_Composition)\lib\netstandard2.0\**\*" />
<MicrosoftDiagnosticsNETCoreClient Include="$(PkgMicrosoft_Diagnostics_NETCore_Client)\lib\netstandard2.0\**\*" />
<MicrosoftInternalDia Include="$(PkgMicrosoft_Internal_Dia)\tools\net451\**\*" />
</ItemGroup>

<Copy SourceFiles="@(MicrosoftCodeCoverageIO)" DestinationFiles="$(OutDir)\Microsoft.CodeCoverage.IO\%(RecursiveDir)%(Filename)%(Extension)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppMinimum);$(NetFrameworkMinimum)</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/TestAssets/SimpleClassLibrary/SimpleClassLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<TargetFrameworks>$(NetFrameworkMinimum);$(NetCoreAppMinimum)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" />
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework">
<Reference Include="System.Net.Http" />
</ItemGroup>

<PropertyGroup Condition="$(NetCoreAppTargetFramework) == 'true' and $(Configuration) == 'Debug'">
Expand Down
Loading