From 1f8756b47931e4ed11e1a2c6bd9af54f3c958a81 Mon Sep 17 00:00:00 2001 From: "Eric St. John" Date: Mon, 28 Aug 2017 10:34:51 -0700 Subject: [PATCH] Add mscorlib facade for refs consuming Windows.winmd Reference assemblies consuming Windows.winmd need to have an mscorlib facade because Windows.winmd has references to types in mscorlib. --- .../ref/System.Runtime.WindowsRuntime.csproj | 1 + .../ref/Configurations.props | 8 +++++ src/mscorlib.WinRT-Facade/ref/TypeForwards.cs | 33 +++++++++++++++++++ .../ref/mscorlib.WinRT-Facade.csproj | 19 +++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/mscorlib.WinRT-Facade/ref/Configurations.props create mode 100644 src/mscorlib.WinRT-Facade/ref/TypeForwards.cs create mode 100644 src/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj diff --git a/src/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj b/src/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj index 4ad28632fd18..02e0a93c0966 100644 --- a/src/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj +++ b/src/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj @@ -22,6 +22,7 @@ + diff --git a/src/mscorlib.WinRT-Facade/ref/Configurations.props b/src/mscorlib.WinRT-Facade/ref/Configurations.props new file mode 100644 index 000000000000..dda77b52b94e --- /dev/null +++ b/src/mscorlib.WinRT-Facade/ref/Configurations.props @@ -0,0 +1,8 @@ + + + + + uap; + + + \ No newline at end of file diff --git a/src/mscorlib.WinRT-Facade/ref/TypeForwards.cs b/src/mscorlib.WinRT-Facade/ref/TypeForwards.cs new file mode 100644 index 000000000000..7625e953a0bd --- /dev/null +++ b/src/mscorlib.WinRT-Facade/ref/TypeForwards.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.CompilerServices; + +// The following types are can be referenced by windows.winmd and are spec'ed to come from mscorlib +[assembly: TypeForwardedTo(typeof(System.Attribute))] +[assembly: TypeForwardedTo(typeof(System.Boolean))] +[assembly: TypeForwardedTo(typeof(System.Byte))] +[assembly: TypeForwardedTo(typeof(System.Char))] +[assembly: TypeForwardedTo(typeof(System.Double))] +[assembly: TypeForwardedTo(typeof(System.Enum))] +[assembly: TypeForwardedTo(typeof(System.FlagsAttribute))] +[assembly: TypeForwardedTo(typeof(System.Guid))] +[assembly: TypeForwardedTo(typeof(System.Int16))] +[assembly: TypeForwardedTo(typeof(System.Int32))] +[assembly: TypeForwardedTo(typeof(System.Int64))] +[assembly: TypeForwardedTo(typeof(System.IntPtr))] +[assembly: TypeForwardedTo(typeof(System.MulticastDelegate))] +[assembly: TypeForwardedTo(typeof(System.Object))] +[assembly: TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsConst))] +[assembly: TypeForwardedTo(typeof(System.Single))] +[assembly: TypeForwardedTo(typeof(System.String))] +[assembly: TypeForwardedTo(typeof(System.Type))] +[assembly: TypeForwardedTo(typeof(System.UInt16))] +[assembly: TypeForwardedTo(typeof(System.UInt32))] +[assembly: TypeForwardedTo(typeof(System.UInt64))] +[assembly: TypeForwardedTo(typeof(System.ValueType))] +[assembly: TypeForwardedTo(typeof(void))] // System.Void + +// XAML compiler is checking for the following +[assembly: TypeForwardedTo(typeof(System.Array))] \ No newline at end of file diff --git a/src/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj b/src/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj new file mode 100644 index 000000000000..f60705ffc0e0 --- /dev/null +++ b/src/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj @@ -0,0 +1,19 @@ + + + + + mscorlib + 4.0.0.0 + true + + false + + + + + + + + + \ No newline at end of file