Skip to content

Commit 14c0350

Browse files
authored
Stop harvesting S.Security.Cryptography.Pkcs (#52045)
* Stop harvesting S.Sec.Cryptography.Pkcs The removed configurations (netstandard1.3, netcoreapp2.1, net46) of the touched packages aren't built anymore. Instead the already built matching binaries from the latest available packages are redistributed when packaging these libraries. Dropping these assets as the minimum supported set of platforms are ones that support netstandard2.0 and are still in-support. As an example, also dropping the netcoreapp2.1 asset which isn't supported anymore and adding a target to prevent the package being used for netcoreapp2.x. For .NET Framework, there's still a net461 configuration present to avoid binding redirect issues. Contributes to #47530 * Fix the build * Remove workaround and mark Xamarin supported
1 parent d6f228e commit 14c0350

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

src/libraries/System.Security.Cryptography.Pkcs/pkg/System.Security.Cryptography.Pkcs.pkgproj

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
33
<ItemGroup>
44
<ProjectReference Include="..\ref\System.Security.Cryptography.Pkcs.csproj">
5-
<SupportedFramework>net461;netcoreapp3.0</SupportedFramework>
5+
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
66
</ProjectReference>
77
<ProjectReference Include="..\src\System.Security.Cryptography.Pkcs.csproj" />
8-
<HarvestIncludePaths Include="ref/net46;lib/net46;runtimes/win/lib/net46" />
9-
<HarvestIncludePaths Include="ref/netstandard1.3;runtimes/win/lib/netstandard1.3;lib/netstandard1.3" />
10-
<HarvestIncludePaths Include="ref/netstandard2.0" />
11-
<HarvestIncludePaths Include="ref/netcoreapp2.1;lib/netcoreapp2.1;runtimes/win/lib/netcoreapp2.1" />
12-
<!--
13-
Suppress NETStandard.Library collpasing as it add more dependencies then needed in some
14-
scenarios like .NET Framework which adds an unecessary amount of package dependencies to download
15-
-->
16-
<SuppressMetaPackage Include="NETStandard.Library" />
8+
<PackageFile Include="buildTransitive\System.Security.Cryptography.Pkcs.targets"
9+
TargetPath="buildTransitive\netcoreapp2.0" />
10+
<File Include="$(PlaceholderFile)"
11+
TargetPath="buildTransitive\netcoreapp3.0" />
12+
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
13+
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore50;uap10.0;net46" />
1714
</ItemGroup>
1815
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
1916
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project InitialTargets="_ErrorForSystemSecurityCryptographyPkcsOnNetCoreApp20">
2+
<Target Name="_ErrorForSystemSecurityCryptographyPkcsOnNetCoreApp20"
3+
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
4+
<Error Text="System.Security.Cryptography.Pkcs doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp3.1 or later." />
5+
</Target>
6+
</Project>

src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;net461</TargetFrameworks>
3+
<TargetFrameworks>$(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
44
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
88
<PropertyGroup>
9-
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
10-
<!-- Currently the netstandard build is locked to the net472 API -->
11-
<AssemblyVersion Condition="$(TargetFramework.StartsWith('netstandard'))">4.0.4.0</AssemblyVersion>
9+
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'net461'">true</IsPartialFacadeAssembly>
1210
</PropertyGroup>
1311
<ItemGroup>
1412
<Compile Include="System.Security.Cryptography.Pkcs.cs" />
15-
<Compile Include="System.Security.Cryptography.Pkcs.netcoreapp.cs" Condition="!$(TargetFramework.StartsWith('net4'))" />
13+
<Compile Include="System.Security.Cryptography.Pkcs.netcoreapp.cs" Condition="'$(TargetFramework)' != 'net461' and '$(TargetFramework)' != 'netstandard2.0'" />
1614
</ItemGroup>
17-
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
15+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
1816
<Reference Include="System.Security" />
1917
</ItemGroup>
2018
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">

src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4-
<UsePackageTargetRuntimeDefaults Condition="'$(IsPartialFacadeAssembly)' != 'true'">true</UsePackageTargetRuntimeDefaults>
54
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
65
<NoWarn>$(NoWarn);CA5384</NoWarn>
76
<Nullable>enable</Nullable>
@@ -12,8 +11,7 @@
1211
<PropertyGroup>
1312
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
1413
<OmitResources Condition="$(TargetFramework.StartsWith('net4'))">true</OmitResources>
15-
<!-- Currently the netstandard build is locked to the net472 API -->
16-
<AssemblyVersion Condition="$(TargetFramework.StartsWith('netstandard'))">4.0.4.0</AssemblyVersion>
14+
<UsePackageTargetRuntimeDefaults Condition="'$(IsPartialFacadeAssembly)' != 'true'">true</UsePackageTargetRuntimeDefaults>
1715
</PropertyGroup>
1816
<Import Project="$(CommonPath)System\Security\Cryptography\Asn1\AsnXml.targets" Condition="'$(IsPartialFacadeAssembly)' != 'true'" />
1917
<Import Project="$(CommonPath)System\Security\Cryptography\Asn1Reader\System.Security.Cryptography.Asn1Reader.Shared.projitems" Condition="'$(IsPartialFacadeAssembly)' != 'true'" />
@@ -640,9 +638,6 @@
640638
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
641639
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
642640
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj" />
643-
<!-- Ref assembly for netstandard2.0 isn't live built anymore. -->
644-
<PackageDownload Include="$(MSBuildProjectName)" Version="[$(SystemSecurityCryptographyPkcsVersion)]" />
645-
<ResolvedMatchingContract Include="$(NuGetPackageRoot)$(MSBuildProjectName.ToLowerInvariant())\$(SystemSecurityCryptographyPkcsVersion)\ref\$(TargetFramework)\$(MSBuildProjectName).dll" />
646641
</ItemGroup>
647642
<ItemGroup Condition="!$(TargetFramework.StartsWith('$(NetCoreAppCurrent)'))">
648643
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />

0 commit comments

Comments
 (0)