From: Eric Erhardt Date: Thu, 30 Jul 2020 17:35:09 +0000 (-0500) Subject: Fix ILLink.Substitutions.xml Warnings during Blazor build (#40051) X-Git-Tag: submit/tizen/20210909.063632~6320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e872afcc9184a0c74e15f23cd798cf337d91aa4b;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix ILLink.Substitutions.xml Warnings during Blazor build (#40051) * Fix ILLink warning for System.Runtime.Serialization.Formatters LocalAppContextSwitches is getting trimmed from the Browser specific assembly since it is unused. However, we still have an ILLink.Substitutions.xml file referencing it, causing the warning. The fix is to only include the ILLink.Substitutions.xml file for the non-Browser build. * Fix ILLink warning in System.Runtime.InteropServices.JavaScript When building for Browser, the Runtime.InteropServices.JavaScript assembly doesn't use the System.SR type which causes the ILLinker to trim it during the dotnet/runtme build. But since System.SR is used for the AnyOS build we are generating an ILLink.Substitutions.xml file telling the linker to remove the System.SR type. This causes a warning during the Blazor app build because the Type doesn't exist in the assembly, but the XML file references it. The fix is to not create an System.SR Type, nor embed the resources file, for the Browser build. This will need to be undone once a string is used in the Browser build. --- diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj index c5455ea..072a1f1 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj @@ -8,6 +8,11 @@ SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported + + + true + false + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.xml b/src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.NonBrowser.xml similarity index 100% rename from src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.xml rename to src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.NonBrowser.xml diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj b/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj index 124a497..6d339f8 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj @@ -9,8 +9,8 @@ $(MSBuildThisFileDirectory)ILLink\ - - + + @@ -21,10 +21,6 @@ - - - Common\System\LocalAppContextSwitches.Common.cs - @@ -59,8 +55,6 @@ - - @@ -73,6 +67,16 @@ + + + + + Common\System\LocalAppContextSwitches.Common.cs + + + + +