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 NetCoreAppCurrent rid agnostic tfm to libs
This change adds a NetCoreAppCurrent rid-less configuration which throws
a PNSE to the following libraries:
- System.Console
- System.IO.Compression.ZipFile
- System.IO.Compression
- System.IO.FileSystem.DriveInfo
- System.IO.MemoryMappedFiles
- System.Net.Http
- System.Net.Mail
- System.Net.NameResolution
- System.Net.Primitives
- System.Net.Requests
- System.Net.WebSockets

System.Private.Runtime.InteropServices.JavaScript is excluded from that
list as it doesn't have a contract and hence can't generate a PNSE
assembly. Also it's currently a private assembly.

These are the only libraries that were missing a RID agnostic tfm.

Adding rid-less configurations, even if they just throw PNSEs helps with:
- Platform enablement, i.e. a new "base" platforms like "Browser" usually
  require libraries that are RID specific to support them. By offering a
  RID agnostic PNSE tfm, projects can gradually support new platforms.
- Making it possible to have ProjectReferences between libraries, i.e.
  imagine an microsoft.build.notargets / microsoft.build.traversal
  project with a `$(NetCoreAppCurrent)-$(TargetOS)` tfm which P2Ps all
  source projects. NuGet can't know that a $(NetCoreAppCurrent)-Linux
  tfm can reference a project with a $(NetCoreAppCurrent)-Unix tfm and
  will throw during restore, more precisely during the compatibility
  check. Ideally NuGet or the SDK would support targeting platforms from
  the runtime.json RID graph, including its compatiblity matrix but
  that isn't the case today.

Even though the added tfms add to the build, I have other changes
in the pipeline which depend on this one which will make the build
noticeably faster.
  • Loading branch information
ViktorHofer committed Jan 31, 2022
commit 75281eebbdefc7a4bd41805c3ca6d9111a27eab0
3 changes: 3 additions & 0 deletions src/libraries/System.Console/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,7 @@
<data name="IO_TermInfoInvalidMagicNumber" xml:space="preserve">
<value>The terminfo database has an invalid magic number: '{0}'.</value>
</data>
<data name="PlatformNotSupported_SystemConsole" xml:space="preserve">
<value>System.Console is not supported on this platform.</value>
</data>
</root>
9 changes: 7 additions & 2 deletions src/libraries/System.Console/src/System.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_SystemConsole</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Console.cs" />
<Compile Include="System\ConsoleCancelEventArgs.cs" />
<Compile Include="System\ConsoleColor.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@
<data name="UnauthorizedAccess_IODenied_Path" xml:space="preserve">
<value>Access to the path '{0}' is denied.</value>
</data>
<data name="PlatformNotSupported_CompressionZipFile" xml:space="preserve">
<value>System.IO.Compression.ZipFile is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_CompressionZipFile</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\IO\Compression\ZipFile.Create.cs" />
<Compile Include="System\IO\Compression\ZipFile.Extract.cs" />
<Compile Include="System\IO\Compression\ZipFile.Utils.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,7 @@
<data name="EntryNameAlreadyExists" xml:space="preserve">
<value>An entry named '{0}' already exists in the archive.</value>
</data>
<data name="PlatformNotSupported_Compression" xml:space="preserve">
<value>System.IO.Compression is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_Compression</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="$(CommonPath)Interop\Interop.zlib.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipArchive.cs" />
<Compile Include="$(SharedOpenSourcePath)System\IO\Compression\ZipArchiveEntry.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,7 @@
<data name="IO_PathTooLong_Path" xml:space="preserve">
<value>The path '{0}' is too long, or a component of the specified path is too long.</value>
</data>
<data name="PlatformNotSupported_FileSystemDriveInfo" xml:space="preserve">
<value>System.IO.FileSystem.DriveInfo is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_FileSystemDriveInfo</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\IO\DriveInfo.cs" />
<Compile Include="System\IO\DriveNotFoundException.cs" />
<Compile Include="System\IO\DriveType.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,7 @@
<data name="IO_PathTooLong_Path" xml:space="preserve">
<value>The path '{0}' is too long, or a component of the specified path is too long.</value>
</data>
</root>
<data name="PlatformNotSupported_MemoryMappedFiles" xml:space="preserve">
<value>System.IO.MemoryMappedFiles is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
</PropertyGroup>
<!-- Compiled Source Files -->
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_MemoryMappedFiles</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="Microsoft\Win32\SafeMemoryMappedFileHandle.cs" />
<Compile Include="Microsoft\Win32\SafeMemoryMappedViewHandle.cs" />
<Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFileOptions.cs" />
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Net.Http/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,7 @@
<data name="net_http_proxy_tunnel_returned_failure_status_code" xml:space="preserve">
<value>The proxy tunnel request to proxy '{0}' failed with status code '{1}'."</value>
</data>
<data name="PlatformNotSupported_NetHttp" xml:space="preserve">
<value>System.Net.Http is not supported on this platform.</value>
</data>
</root>
26 changes: 14 additions & 12 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<WindowsRID>win</WindowsRID>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Android</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">
Expand Down Expand Up @@ -31,21 +31,29 @@
<PropertyGroup>
<ILLinkDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkDirectory>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
Copy link
Member

@safern safern Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we or is it worth to this globally for all projects that multitarget or is that an expensive call? I ask cause I see this property being set in multiple projects.

I guess it won't work because of DesignTimeBuild but I figured I'd ask.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK already does this but in the TargetFrameworkInference.targets file which means the property won't be for properties inside the project file. Because of that, we are setting it ourselves in exactly the same way the SDK sets it and the result will be cached and the duplicate is avoided.

We can't set this globally as it relies on the TargetFramework prop which isn't available at that point.

<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_NetHttp</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
<ILLinkSubstitutionsXmls Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsTVOS)' == 'true'"
Include="$(ILLinkDirectory)ILLink.Substitutions.mobile.xml" />
<ILLinkSuppressionsXmls Condition="'$(TargetsMobile)' == 'true'" Include="$(ILLinkDirectory)ILLink.Suppressions.Mobile.LibraryBuild.xml" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Http\ByteArrayContent.cs" />
<Compile Include="System\Net\Http\ByteArrayHelpers.cs" />
<Compile Include="System\Net\Http\CancellationHelper.cs" />
<Compile Include="System\Net\Http\ClientCertificateOption.cs" />
<Compile Include="System\Net\Http\DelegatingHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandlerLoggingStrings.cs" />
<Compile Include="System\Net\Http\EmptyContent.cs" />
<Compile Include="System\Net\Http\EmptyReadStream.cs" />
<Compile Include="System\Net\Http\FormUrlEncodedContent.cs" />
<Compile Include="System\Net\Http\GlobalHttpSettings.cs" />
<Compile Include="System\Net\Http\HeaderEncodingSelector.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeader.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderType.cs" />
Expand Down Expand Up @@ -128,6 +136,7 @@
<Compile Include="System\Net\Http\Headers\UriHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ViaHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\WarningHeaderValue.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs" />
<Compile Include="$(CommonPath)System\IO\DelegatingStream.cs"
Link="Common\System\IO\DelegatingStream.cs" />
<Compile Include="$(CommonPath)System\IO\ReadOnlyMemoryStream.cs"
Expand All @@ -140,6 +149,8 @@
Link="Common\System\Net\HttpDateParser.cs" />
<Compile Include="$(CommonPath)System\Text\SimpleRegex.cs"
Link="Common\System\Text\SimpleRegex.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs"
Link="Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs" />
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs"
Expand All @@ -152,7 +163,7 @@
Link="Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs" />
</ItemGroup>
<!-- SocketsHttpHandler implementation -->
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetsBrowser)' != 'true'">
<Compile Include="System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="System\Net\Http\HttpMethod.Http3.cs" />
<Compile Include="System\Net\Http\Headers\AltSvcHeaderParser.cs" />
Expand Down Expand Up @@ -521,15 +532,6 @@
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIWrapper.cs"
Link="Common\Interop\Windows\SspiCli\SSPIWrapper.cs" />
</ItemGroup>
<!-- Common -->
<ItemGroup>
<Compile Include="System\Net\Http\DiagnosticsHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandlerLoggingStrings.cs" />
<Compile Include="System\Net\Http\GlobalHttpSettings.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs"
Link="Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(CommonPath)System\StrongToWeakReference.cs"
Link="Common\Interop\Unix\StrongToWeakReference.cs" />
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Net.Mail/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,7 @@
<data name="SmtpGetIisPickupDirectoryNotSupported" xml:space="preserve">
<value>IIS delivery is not supported.</value>
</data>
<data name="PlatformNotSupported_NetMail" xml:space="preserve">
<value>System.Net.Mail is not supported on this platform.</value>
</data>
</root>
12 changes: 8 additions & 4 deletions src/libraries/System.Net.Mail/src/System.Net.Mail.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-tvOS</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
<DefineConstants Condition="'$(TargetstvOS)' == 'true'">$(DefineConstants);NO_NTAUTHENTICATION</DefineConstants>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<ItemGroup>
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_NetMail</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Base64Stream.cs" />
<Compile Include="System\Net\Mime\MimePart.cs" />
<Compile Include="System\Net\Mime\Base64WriteStateInfo.cs" />
Expand Down Expand Up @@ -77,7 +81,7 @@
</ItemGroup>

<!-- Non Browser specific files - internal and security -->
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetsBrowser)' != 'true'">
<Compile Include="System\Net\Mail\SmtpClient.cs" />
<Compile Include="System\Net\Mail\ISmtpAuthenticationModule.cs" />
<Compile Include="System\Net\Mail\SmtpAuthenticationManager.cs" />
Expand Down Expand Up @@ -115,7 +119,7 @@
</ItemGroup>

<!-- NT authentication specific files -->
<ItemGroup Condition="'$(TargetsBrowser)' != 'true' and '$(TargetstvOS)' != 'true'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetsBrowser)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="$(CommonPath)System\Net\ContextFlagsPal.cs"
Link="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="$(CommonPath)System\Net\NegotiationInfoClass.cs"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == 'Browser' or '$(TargetPlatformIdentifier)' == ''">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<ApiExclusionListPath Condition="'$(TargetsBrowser)' == 'true'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
</PropertyGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' == ''">
<Compile Include="System\Net\Dns.cs" />
<Compile Include="System\Net\IPHostEntry.cs" />
<Compile Include="System\Net\NetEventSource.NameResolution.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@
<data name="bad_endpoint_string" xml:space="preserve">
<value>An invalid IPEndPoint was specified.</value>
</data>
<data name="PlatformNotSupported_NetPrimitives" xml:space="preserve">
<value>System.Net.Primitives is not supported on this platform.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ILLinkKeepDepAttributes>false</ILLinkKeepDepAttributes> <!-- See comments in Cookie.cs -->
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<!-- SYSTEM_NET_PRIMITIVES_DLL is required to allow source-level code sharing for types defined within the
System.Net.Internals namespace. -->
<DefineConstants>$(DefineConstants);SYSTEM_NET_PRIMITIVES_DLL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_NetPrimitives</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\AuthenticationSchemes.cs" />
<Compile Include="System\Net\Cookie.cs" />
<Compile Include="System\Net\CookieContainer.cs" />
Expand Down
Loading