Skip to content

Commit 196fd18

Browse files
authored
[browser] Mark APIs as unsupported on browser (#40612)
* Mark System.Security.Cryptography.OpenSsl as unsupported on browser * Mark other System.Security.Cryptography APIs as unsupported on browser * Mark System.Data.Odbc.* as unsupported on browser * Mark System.DirectoryServices.Protocols APIs as unsupported on browser * Mark System.Drawing.Common APIs as unsupported on browser * Mark System.IO.Ports as unsupported on browser
1 parent 7a7c9e0 commit 196fd18

File tree

12 files changed

+29
-6
lines changed

12 files changed

+29
-6
lines changed

eng/versioning.targets

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@
2929
</AssemblyAttribute>
3030
</ItemGroup>
3131

32-
<!-- Adds UnsupportedOSPlatform attribute for requested libraries -->
33-
<ItemGroup Condition="'$(UnsupportedOSPlatform)' != '' and '$(IsTestProject)' != 'true'">
34-
<AssemblyAttribute Include="System.Runtime.Versioning.UnsupportedOSPlatform">
35-
<_Parameter1>$(UnsupportedOSPlatform)</_Parameter1>
36-
</AssemblyAttribute>
32+
<ItemGroup>
33+
<_unsupportedOSPlatforms Include="$(UnsupportedOSPlatforms)" />
3734
</ItemGroup>
3835

36+
<Target Name="AddUnsupportedOSPlatformAttribute" BeforeTargets="GenerateAssemblyInfo" AfterTargets="PrepareForBuild">
37+
<ItemGroup>
38+
<AssemblyAttribute Include="System.Runtime.Versioning.UnsupportedOSPlatform" Condition="'@(_unsupportedOSPlatforms)' != ''">
39+
<_Parameter1>%(_unsupportedOSPlatforms.Identity)</_Parameter1>
40+
</AssemblyAttribute>
41+
</ItemGroup>
42+
</Target>
43+
3944
<Target Name="DecideIfWeNeedToIncludeDllSafeSearchPathAttribute"
4045
Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">
4146

src/libraries/System.Data.Odbc/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Open</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

src/libraries/System.DirectoryServices.Protocols/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
to a different assembly. -->
77
<AssemblyVersion>4.0.0.0</AssemblyVersion>
88
<StrongNameKeyId>Microsoft</StrongNameKeyId>
9+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
10+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
911
</PropertyGroup>
1012
</Project>

src/libraries/System.Drawing.Common/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Open</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

src/libraries/System.IO.Ports/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Open</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

src/libraries/System.Security.Cryptography.Csp/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<PropertyGroup>
44
<StrongNameKeyId>Microsoft</StrongNameKeyId>
55
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
67
</PropertyGroup>
78
</Project>

src/libraries/System.Security.Cryptography.Encoding/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Microsoft</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

src/libraries/System.Security.Cryptography.OpenSsl/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<PropertyGroup>
44
<StrongNameKeyId>Microsoft</StrongNameKeyId>
55
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6-
<UnsupportedOSPlatform>windows</UnsupportedOSPlatform>
6+
<UnsupportedOSPlatforms>windows;browser</UnsupportedOSPlatforms>
77
</PropertyGroup>
88
</Project>

src/libraries/System.Security.Cryptography.Pkcs/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Microsoft</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

src/libraries/System.Security.Cryptography.Primitives/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33
<PropertyGroup>
44
<StrongNameKeyId>Microsoft</StrongNameKeyId>
5+
<IncludePlatformAttributes>true</IncludePlatformAttributes>
6+
<UnsupportedOSPlatforms>browser</UnsupportedOSPlatforms>
57
</PropertyGroup>
68
</Project>

0 commit comments

Comments
 (0)