diff --git a/src/System.Management.Automation/utils/MshTraceSource.cs b/src/System.Management.Automation/utils/MshTraceSource.cs index 41486f5c0f..1b5b7c305a 100644 --- a/src/System.Management.Automation/utils/MshTraceSource.cs +++ b/src/System.Management.Automation/utils/MshTraceSource.cs @@ -178,11 +178,6 @@ namespace System.Management.Automation PSTraceSource.TraceCatalog[result.FullName] = result; } -#if !CORECLR // System.AppDomain is not in ProjectK - // Trace the global header if this is the first - // trace object for the AppDomain and tracing flags - // are enabled. - if (result.Options != PSTraceSourceOptions.None && traceHeaders) { @@ -191,7 +186,6 @@ namespace System.Management.Automation // Trace the object specific tracer information result.TracerObjectHeader(Assembly.GetCallingAssembly()); } -#endif return result; } } @@ -359,12 +353,8 @@ namespace System.Management.Automation /// Exception instance ready to throw internal static PSInvalidOperationException NewInvalidOperationException() { -#if CORECLR //TODO:CORECLR StackTrace is not in CoreCLR - string message = string.Empty; -#else string message = StringUtil.Format(AutomationExceptions.InvalidOperation, new System.Diagnostics.StackTrace().GetFrame(1).GetMethod().Name); -#endif var e = new PSInvalidOperationException(message); return e; @@ -434,12 +424,8 @@ namespace System.Management.Automation /// Exception instance ready to throw internal static PSNotSupportedException NewNotSupportedException() { -#if CORECLR //TODO:CORECLR StackTrace is not in CoreCLR - string message = string.Empty; -#else string message = StringUtil.Format(AutomationExceptions.NotSupported, new System.Diagnostics.StackTrace().GetFrame(0).ToString()); -#endif var e = new PSNotSupportedException(message); return e; @@ -483,12 +469,8 @@ namespace System.Management.Automation /// Exception instance ready to throw internal static PSNotImplementedException NewNotImplementedException() { -#if CORECLR //TODO:CORECLR StackTrace is not in CoreCLR - string message = string.Empty; -#else string message = StringUtil.Format(AutomationExceptions.NotImplemented, new System.Diagnostics.StackTrace().GetFrame(0).ToString()); -#endif var e = new PSNotImplementedException(message); return e; diff --git a/src/System.Management.Automation/utils/StructuredTraceSource.cs b/src/System.Management.Automation/utils/StructuredTraceSource.cs index ba62d4864c..0c94fa9659 100644 --- a/src/System.Management.Automation/utils/StructuredTraceSource.cs +++ b/src/System.Management.Automation/utils/StructuredTraceSource.cs @@ -290,7 +290,7 @@ namespace System.Management.Automation FullName = fullName; _name = name; -#if !CORECLR // TraceSource.Attributes is not in CoreCLR + // TODO: move this to startup json file instead of using env var string tracingEnvVar = Environment.GetEnvironmentVariable("MshEnableTrace"); if (String.Equals( @@ -304,7 +304,6 @@ namespace System.Management.Automation _flags = (PSTraceSourceOptions)Enum.Parse(typeof(PSTraceSourceOptions), options, true); } } -#endif ShowHeaders = traceHeaders; Description = description; } @@ -326,7 +325,6 @@ namespace System.Management.Automation #endif } -#if !CORECLR // System.AppDomain is not in ProjectK. private static bool globalTraceInitialized; /// @@ -375,7 +373,6 @@ namespace System.Management.Automation globalTraceInitialized = true; } -#endif /// /// Outputs a header when a new StructuredTraceSource object is created @@ -1149,9 +1146,6 @@ namespace System.Management.Automation /// private static string GetCallingMethodNameAndParameters(int skipFrames) { -#if CORECLR //TODO:CORECLR StackFrame is not in CoreCLR - return string.Empty; -#else StringBuilder methodAndParameters = null; try @@ -1189,7 +1183,6 @@ namespace System.Management.Automation // normal operation. } return methodAndParameters.ToString(); -#endif } // The default formatter for TraceError @@ -1482,7 +1475,6 @@ namespace System.Management.Automation get { return _flags != PSTraceSourceOptions.None; } } -#if !CORECLR // TraceSource.Attributes is not in CoreCLR /// /// Gets the attributes of the TraceSource /// @@ -1493,7 +1485,6 @@ namespace System.Management.Automation return TraceSource.Attributes; } } -#endif /// /// Gets the listeners for the TraceSource @@ -1891,7 +1882,6 @@ namespace System.Management.Automation { } -#if !CORECLR // TraceSource.GetSupportedAttributes is not in CoreCLR /// /// Tells the config infrastructure which attributes are supported /// for our TraceSource @@ -1905,7 +1895,6 @@ namespace System.Management.Automation { return new string[] { "Options" }; } -#endif } #endregion MonadTraceSource }