From 666f149167b77a9692174b428dac073f7acbfe08 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 7 Apr 2017 16:49:04 -0700 Subject: [PATCH] Merge pull request dotnet/corertdotnet/coreclr#3262 from dotnet/nmirror Merge nmirror to master Signed-off-by: dotnet-bot Commit migrated from https://github.com/dotnet/coreclr/commit/25e16c372912cfe9685c142ecf64edd4df91d21e --- .../shared/System/Diagnostics/Tracing/EventDescriptor.cs | 16 +++++++++++++++- .../shared/System/Diagnostics/Tracing/EventSource.cs | 16 +++++++++++++++- .../System/Diagnostics/Tracing/EventSourceException.cs | 4 ++-- .../shared/System/Diagnostics/Tracing/StubEnvironment.cs | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs index a1dcf1c..8fb471a 100644 --- a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs +++ b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs @@ -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)] diff --git a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index ba2bcd7..53aaae1 100644 --- a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -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. /// - 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; diff --git a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs index 89d3ee55..88b8da9 100644 --- a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs +++ b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs @@ -18,7 +18,7 @@ namespace System.Diagnostics.Tracing /// /// Exception that is thrown when an error occurs during EventSource operation. /// -#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 /// public EventSourceException(string message, Exception innerException) : base(message, innerException) { } -#if (!ES_BUILD_PCL && !ES_BUILD_PN) +#if !ES_BUILD_PCL /// /// Initializes a new instance of the EventSourceException class with serialized data. /// diff --git a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs index add2812..b365841 100644 --- a/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs +++ b/src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs @@ -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() { -- 2.7.4