Add dummy impl for platform specific API

This adds dummy implementations for platform specific API.  The
implementation assemblies throw PlatformNotSupported for all methods.

This will satisfy NuGet's guardrails check and also let folks compile
against these assemblies and load them at runtime without JIT failures.

We will not be placing these packages in any of the shared-framework
layouts, nor should any of these ever be depended on by CoreFx
libraries.  But we will provide them to enable folks to write platform
lightup code without having to worry about using reflection or guarding
calls in separate methods disabling JIT inlining.

These assemblies are marked with AssemblyMetadata("NotSupported",
"True"), so that future dev-time tooling can detect them and warn/error
in the case of accidental dependence on platform specific API.

One notable difference is
System.Runtime.InteropSerivices.WindowsRuntime: this assembly was
previously part of portable profiles and implementation exists in
mscorlib.  For this we will forward to mscorlib on all platforms and it
is up to mscorlib to determine implementation (throw vs noop).
Fixes https://github.com/dotnet/corefx/issues/6684

Other platform specific contracts that have been excluded:
System.IO.IsolatedStorage: currently only supported for netcore50 so no
need to address this problem for x-plat.
System.Runtime.WindowsRuntime & System.Runtime.WindowsRuntime.UI.Xaml:
both are WinRT specific and not exposed in any PCL profiles that we
expect folks to use with x-plat NET core.


Commit migrated from https://github.com/dotnet/corefx/commit/b12b5604c442c13b983f530e5bccfc0867f160cf
This commit is contained in:
Eric St. John committed 2016-03-17 14:21:08 -07:00
1 parent a15ad38fab
commit 12e01eeda2
41 files changed
+108 -140

No files matched your search

@@ -11,12 +11,6 @@
<NotSupportedOnTargetFramework Include="netcore50">
<PackageTargetRuntime>win</PackageTargetRuntime>
</NotSupportedOnTargetFramework>
<ExcludeDefaultValidateFramework Include="netstandardapp1.5" />
<!-- Only supported on windows, so overriding
the validation RID's -->
<ValidateFramework Include="netstandardapp1.5">
<RuntimeIDs>win7-x86;win7-x64</RuntimeIDs>
</ValidateFramework>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
@@ -2,7 +2,12 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.IO.FileSystem.AccessControl.csproj" />
<Project Include="System.IO.FileSystem.AccessControl.csproj">
<OSGroup>Windows_NT</OSGroup>
</Project>
<Project Include="System.IO.FileSystem.AccessControl.csproj" >
<OSGroup>Unix</OSGroup>
</Project>
<Project Include="System.IO.FileSystem.AccessControl.csproj">
<TargetGroup>net46</TargetGroup>
</Project>
@@ -7,7 +7,9 @@
<ProjectGuid>{D77FBA6C-1AA6-45A4-93E2-97A370672C53}</ProjectGuid>
<AllowUnsafeBlocks Condition="'$(TargetGroup)'==''">true</AllowUnsafeBlocks>
<PackageTargetFramework Condition="'$(PackageTargetFramework)'==''">netstandard1.3</PackageTargetFramework>
<PackageTargetRuntime Condition="'$(TargetGroup)' == ''">win</PackageTargetRuntime>
<PackageTargetRuntime Condition="'$(TargetGroup)' != 'net46' AND '$(TargetsWindows)' == 'true'">win</PackageTargetRuntime>
<PackageTargetRuntime Condition="'$(TargetsUnix)' == 'true'">unix</PackageTargetRuntime>
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsUnix)' == 'true'">true</GeneratePlatformNotSupportedAssembly>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net46'">true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.3</NuGetTargetMoniker>
</PropertyGroup>
@@ -16,7 +18,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)'!='net46'">
<ItemGroup Condition="'$(TargetGroup)'!='net46' AND '$(TargetsWindows)'=='true'">
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.Errors.cs">
<Link>Common\Interop\Windows\mincore\Interop.Errors.cs</Link>
</Compile>