From: Stephen Toub Date: Wed, 18 Sep 2019 19:29:16 +0000 (-0400) Subject: Fix trimming of System.Net.Ping (dotnet/corefx#41180) X-Git-Tag: submit/tizen/20210909.063632~11031^2~440 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d63469a273f4a677f1e896ebbc4323a7691365af;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix trimming of System.Net.Ping (dotnet/corefx#41180) It has an ILLinkTrim.xml file that was keeping a type around for testing, but that's apparently keeping the assembly from being trimmed in a published app. Commit migrated from https://github.com/dotnet/corefx/commit/64c7228b941d1402009c57441a5a8c634d0e6843 --- diff --git a/src/libraries/System.Net.Ping/src/ILLinkTrim.xml b/src/libraries/System.Net.Ping/src/ILLinkTrim.xml deleted file mode 100644 index aa0107d..0000000 --- a/src/libraries/System.Net.Ping/src/ILLinkTrim.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/LoggingTest.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/LoggingTest.cs index f82fec7..bb4ebd7 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/LoggingTest.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/LoggingTest.cs @@ -12,13 +12,13 @@ namespace System.Net.NetworkInformation.Tests [Fact] public void EventSource_ExistsWithCorrectId() { - Type esType = typeof(Ping).Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false); - Assert.NotNull(esType); - - Assert.Equal("Microsoft-System-Net-Ping", EventSource.GetName(esType)); - Assert.Equal(Guid.Parse("a771ec4a-7260-59ce-0475-db257437ed8c"), EventSource.GetGuid(esType)); - - Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); + Type esType = typeof(Ping).Assembly.GetType("System.Net.NetEventSource", throwOnError: false, ignoreCase: false); + if (esType != null) + { + Assert.Equal("Microsoft-System-Net-Ping", EventSource.GetName(esType)); + Assert.Equal(Guid.Parse("a771ec4a-7260-59ce-0475-db257437ed8c"), EventSource.GetGuid(esType)); + Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); + } } } }