From d63469a273f4a677f1e896ebbc4323a7691365af Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 18 Sep 2019 15:29:16 -0400 Subject: [PATCH] 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 --- src/libraries/System.Net.Ping/src/ILLinkTrim.xml | 6 ------ .../System.Net.Ping/tests/FunctionalTests/LoggingTest.cs | 14 +++++++------- 2 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 src/libraries/System.Net.Ping/src/ILLinkTrim.xml 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)); + } } } } -- 2.7.4