Fix trimming of System.Net.NetworkInformation (dotnet/corefx#41191)
authorStephen Toub <stoub@microsoft.com>
Thu, 19 Sep 2019 02:42:17 +0000 (22:42 -0400)
committerGitHub <noreply@github.com>
Thu, 19 Sep 2019 02:42:17 +0000 (22:42 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/2f1d199cf19572dc319be344ea0905edbf318ea3

src/libraries/System.Net.NetworkInformation/src/ILLinkTrim.xml [deleted file]
src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/LoggingTest.cs

diff --git a/src/libraries/System.Net.NetworkInformation/src/ILLinkTrim.xml b/src/libraries/System.Net.NetworkInformation/src/ILLinkTrim.xml
deleted file mode 100644 (file)
index 8d52a51..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<linker>
-  <assembly fullname="System.Net.NetworkInformation">
-    <!-- NetEventSource isn't used by this assembly but tests check for its presence -->
-    <type fullname="System.Net.NetEventSource" />
-  </assembly>
-</linker>
\ No newline at end of file
index fb95d4b..63b65f3 100644 (file)
@@ -12,13 +12,14 @@ namespace System.Net.NetworkInformation.Tests
         [Fact]
         public void EventSource_ExistsWithCorrectId()
         {
-            Type esType = typeof(NetworkChange).Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false);
-            Assert.NotNull(esType);
+            Type esType = typeof(NetworkChange).Assembly.GetType("System.Net.NetEventSource", throwOnError: false, ignoreCase: false);
+            if (esType != null)
+            {
+                Assert.Equal("Microsoft-System-Net-NetworkInformation", EventSource.GetName(esType));
+                Assert.Equal(Guid.Parse("b8e42167-0eb2-5e39-97b5-acaca593d3a2"), EventSource.GetGuid(esType));
 
-            Assert.Equal("Microsoft-System-Net-NetworkInformation", EventSource.GetName(esType));
-            Assert.Equal(Guid.Parse("b8e42167-0eb2-5e39-97b5-acaca593d3a2"), EventSource.GetGuid(esType));
-
-            Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location));
+                Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location));
+            }
         }
     }
 }