Skip to content

Commit 61587f4

Browse files
authored
Add PlatformNeutralAssembly property for targeted builds of cross platform assembly (dotnet#53626)
1 parent 15eca91 commit 61587f4

File tree

9 files changed

+6
-9
lines changed

9 files changed

+6
-9
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<MicrosoftCodeAnalysisVersion>3.8.0</MicrosoftCodeAnalysisVersion>
4646
</PropertyGroup>
4747
<PropertyGroup>
48-
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview6.21274.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
48+
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview6.21281.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
4949
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.10.0-2.final</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
5050
<MicrosoftCodeAnalysisCSharpVersion>3.10.0-2.final</MicrosoftCodeAnalysisCSharpVersion>
5151
<!-- Arcade dependencies -->

eng/versioning.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@
8484
</ItemGroup>
8585
</Target>
8686

87+
<!-- Add PlatformNeutralAssembly property for targeted builds of cross platform assemblies -->
88+
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true' and '$(IsTestProject)' != 'true' and '@(SupportedOSPlatforms)' == ''">
89+
<CompilerVisibleProperty Include="PlatformNeutralAssembly" />
90+
</ItemGroup>
91+
8792
<PropertyGroup>
8893
<!-- corefx has never generated these attributes so don't let the SDK generate them -->
8994
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ private static async ValueTask<SslStream> EstablishSslConnectionAsyncCore(bool a
101101
return sslStream;
102102
}
103103

104-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
105104
[SupportedOSPlatform("windows")]
106105
[SupportedOSPlatform("linux")]
107106
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace System.Net.Http
1616
{
17-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
1817
[SupportedOSPlatform("windows")]
1918
[SupportedOSPlatform("linux")]
2019
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3ConnectionException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace System.Net.Http
88
{
99
[Serializable]
10-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
1110
[SupportedOSPlatform("windows")]
1211
[SupportedOSPlatform("linux")]
1312
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3ProtocolException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace System.Net.Http
88
{
99
[Serializable]
10-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
1110
[SupportedOSPlatform("windows")]
1211
[SupportedOSPlatform("linux")]
1312
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
namespace System.Net.Http
1818
{
19-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
2019
[SupportedOSPlatform("windows")]
2120
[SupportedOSPlatform("linux")]
2221
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ private void AddHttp2Connection(Http2Connection newConnection)
664664
}
665665
}
666666

667-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
668667
[SupportedOSPlatform("windows")]
669668
[SupportedOSPlatform("linux")]
670669
[SupportedOSPlatform("macos")]
@@ -764,7 +763,6 @@ private async ValueTask<Http3Connection> GetHttp3ConnectionAsync(HttpRequestMess
764763
}
765764

766765
// Returns null if HTTP3 cannot be used.
767-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
768766
[SupportedOSPlatform("windows")]
769767
[SupportedOSPlatform("linux")]
770768
[SupportedOSPlatform("macos")]

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionSettings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private static bool AllowDraftHttp3
187187

188188
private byte[]? _http3SettingsFrame;
189189

190-
// TODO: SupportedOSPlatform doesn't work for internal APIs https://github.com/dotnet/runtime/issues/51305
191190
[SupportedOSPlatform("windows")]
192191
[SupportedOSPlatform("linux")]
193192
[SupportedOSPlatform("macos")]

0 commit comments

Comments
 (0)