Merge pull request dotnet/corertdotnet/coreclr#3262 from dotnet/nmirror
authorJan Kotas <jkotas@microsoft.com>
Fri, 7 Apr 2017 23:49:04 +0000 (16:49 -0700)
committerJan Kotas <jkotas@microsoft.com>
Sat, 8 Apr 2017 01:45:12 +0000 (18:45 -0700)
Merge nmirror to master

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/25e16c372912cfe9685c142ecf64edd4df91d21e

src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs
src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs
src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs
src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs

index a1dcf1c..8fb471a 100644 (file)
@@ -25,7 +25,21 @@ namespace System.Diagnostics.Tracing
 #if !CORECLR && !ES_BUILD_PN    
     [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
 #endif // !CORECLR && !ES_BUILD_PN
-    internal struct EventDescriptor
+
+    /*
+     EventDescriptor was public in the separate System.Diagnostics.Tracing assembly(pre NS2.0), 
+     now the move to CoreLib marked them as private.
+     While they are technically private (it's a contract used between the library and the ILC toolchain), 
+     we need them to be rooted and exported from shared library for the system to work.
+     For now I'm simply marking them as public again.A cleaner solution might be to use.rd.xml to 
+     root them and modify shared library definition to force export them.
+     */
+#if ES_BUILD_PN
+    public
+#else
+    internal
+#endif
+    struct EventDescriptor
     {
         # region private
         [FieldOffset(0)]
index ba2bcd7..53aaae1 100644 (file)
@@ -2504,7 +2504,21 @@ namespace System.Diagnostics.Tracing
         /// descriptor as well as some stuff we added specifically for EventSource. see the
         /// code:m_eventData for where we use this.  
         /// </summary>
-        internal partial struct EventMetadata
+
+        /*
+         EventMetadata was public in the separate System.Diagnostics.Tracing assembly(pre NS2.0), 
+         now the move to CoreLib marked them as private.
+         While they are technically private (it's a contract used between the library and the ILC toolchain), 
+         we need them to be rooted and exported from shared library for the system to work.
+         For now I'm simply marking them as public again.A cleaner solution might be to use.rd.xml to 
+         root them and modify shared library definition to force export them.
+         */
+#if ES_BUILD_PN
+       public
+#else
+       internal
+#endif
+        partial struct EventMetadata
         {
             public EventDescriptor Descriptor;
             public EventTags Tags;
index 89d3ee5..88b8da9 100644 (file)
@@ -18,7 +18,7 @@ namespace System.Diagnostics.Tracing
     /// <summary>
     /// Exception that is thrown when an error occurs during EventSource operation.
     /// </summary>
-#if (!ES_BUILD_PCL && !ES_BUILD_PN)
+#if !ES_BUILD_PCL
     [Serializable]
 #endif
     public class EventSourceException : Exception
@@ -40,7 +40,7 @@ namespace System.Diagnostics.Tracing
         /// </summary>
         public EventSourceException(string message, Exception innerException) : base(message, innerException) { }
 
-#if (!ES_BUILD_PCL && !ES_BUILD_PN)
+#if !ES_BUILD_PCL
         /// <summary>
         /// Initializes a new instance of the EventSourceException class with serialized data.
         /// </summary>
index add2812..b365841 100644 (file)
@@ -370,7 +370,7 @@ namespace System.Security.Permissions
 #if ES_BUILD_PN
 namespace System
 {
-    public static class AppDomain
+    internal static class AppDomain
     {
         public static int GetCurrentThreadId()
         {