Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add PlatformNotSupportedException for Browser version of System.Net.S…
…ockets
  • Loading branch information
marek-safar committed Jul 15, 2020
commit c6c8e5f6bf8be37f92007c80766db84d1243a2ce
5 changes: 4 additions & 1 deletion src/libraries/System.Net.Sockets/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,7 @@
<data name="InvalidNullArgument" xml:space="preserve">
<value>Null is not a valid value for {0}.</value>
</data>
</root>
<data name="Sockets_PlatformNotSupported" xml:space="preserve">
<value>System.Net.Sockets is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.Sockets_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<PropertyGroup>
<!-- SYSTEM_NET_SOCKETS_DLL is required to allow source-level code sharing for types defined within the
System.Net.Internals namespace. -->
<DefineConstants>$(DefineConstants);SYSTEM_NET_SOCKETS_DLL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<!-- All configurations -->
<Compile Include="System\Net\Sockets\SocketReceiveFromResult.cs" />
<Compile Include="System\Net\Sockets\SocketReceiveMessageFromResult.cs" />
Expand Down Expand Up @@ -189,7 +192,7 @@
<Compile Include="$(CommonPath)System\Net\CompletionPortHelper.Windows.cs"
Link="Common\System\Net\CompletionPortHelper.Windows.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true' ">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="System\Net\Sockets\AcceptOverlappedAsyncResult.Unix.cs" />
<Compile Include="System\Net\Sockets\BaseOverlappedAsyncResult.Unix.cs" />
<Compile Include="System\Net\Sockets\ConnectOverlappedAsyncResult.Unix.cs" />
Expand Down Expand Up @@ -317,7 +320,7 @@
<Reference Include="System.Threading.Overlapped" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
Expand Down