private static string ConstructDescriptionString() { var str = new StringBuilder(); string processName = "-Unknown-"; string machineName = "-Unknown-"; int processId = -1; try { CurrentProcess.GetIdentityInfo(out processName, out machineName, out processId); } catch (Exception ex) { Console.WriteLine($"{Environment.NewLine}{ex}"); } str.AppendLine("Environment info"); str.AppendLine("{ "); str.AppendLine($" Process Id: {processId}"); str.AppendLine($" Process Name: {processName}"); str.AppendLine($" Machine Name: {machineName}"); str.AppendLine($" Current Working Dir: {Environment.CurrentDirectory}"); str.AppendLine($" Is64BitProcess: {Environment.Is64BitProcess}"); str.AppendLine($" Runtime version: {Environment.Version}"); str.AppendLine($" OS version: {Environment.OSVersion}"); str.AppendLine($" Common App Data folder: {Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}"); str.AppendLine(); str.AppendLine(" Variables:"); str.AppendLine(); str.AppendLine(" CORECLR_ENABLE_PROFILING: " + (Environment.GetEnvironmentVariable("CORECLR_ENABLE_PROFILING") ?? "null")); str.AppendLine(" CORECLR_PROFILER: " + (Environment.GetEnvironmentVariable("CORECLR_PROFILER") ?? "null")); str.AppendLine(" CORECLR_PROFILER_PATH_64: " + (Environment.GetEnvironmentVariable("CORECLR_PROFILER_PATH_64") ?? "null")); str.AppendLine(" CORECLR_PROFILER_PATH_32: " + (Environment.GetEnvironmentVariable("CORECLR_PROFILER_PATH_32") ?? "null")); str.AppendLine(" CORECLR_PROFILER_PATH: " + (Environment.GetEnvironmentVariable("CORECLR_PROFILER_PATH") ?? "null")); str.AppendLine(); str.AppendLine(" COR_ENABLE_PROFILING: " + (Environment.GetEnvironmentVariable("COR_ENABLE_PROFILING") ?? "null")); str.AppendLine(" COR_PROFILER: " + (Environment.GetEnvironmentVariable("COR_PROFILER") ?? "null")); str.AppendLine(" COR_PROFILER_PATH_64: " + (Environment.GetEnvironmentVariable("COR_PROFILER_PATH_64") ?? "null")); str.AppendLine(" COR_PROFILER_PATH_32: " + (Environment.GetEnvironmentVariable("COR_PROFILER_PATH_32") ?? "null")); str.AppendLine(" COR_PROFILER_PATH: " + (Environment.GetEnvironmentVariable("COR_PROFILER_PATH") ?? "null")); str.AppendLine(); str.AppendLine(" SIGNALFX_DOTNET_PROFILER_HOME: " + (Environment.GetEnvironmentVariable("SIGNALFX_DOTNET_PROFILER_HOME") ?? "null")); str.AppendLine(" SIGNALFX_PROFILING_ENABLED: " + (Environment.GetEnvironmentVariable("SIGNALFX_PROFILING_ENABLED") ?? "null")); str.AppendLine(); str.AppendLine(" SIGNALFX_LOADER_REWRITE_MODULE_INITIALIZER_ENABLED: " + (Environment.GetEnvironmentVariable("SIGNALFX_LOADER_REWRITE_MODULE_INITIALIZER_ENABLED") ?? "null")); str.AppendLine(" SIGNALFX_LOADER_REWRITE_MODULE_ENTRYPOINT_ENABLED: " + (Environment.GetEnvironmentVariable("SIGNALFX_LOADER_REWRITE_MODULE_ENTRYPOINT_ENABLED") ?? "null")); str.AppendLine(" SIGNALFX_LOADER_REWRITE_MSCORLIB_ENABLED: " + (Environment.GetEnvironmentVariable("SIGNALFX_LOADER_REWRITE_MSCORLIB_ENABLED") ?? "null")); str.AppendLine(); str.AppendLine(" COMPlus_EnableDiagnostics: " + (Environment.GetEnvironmentVariable("COMPlus_EnableDiagnostics") ?? "null")); str.AppendLine(); str.AppendLine(" RuntimeEnvironmentInfo:"); str.AppendLine(" " + RuntimeEnvironmentInfo.SingeltonInstance.ToString()); str.AppendLine(); str.AppendLine(" AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName:"); str.AppendLine(" \"" + (AppDomain.CurrentDomain?.SetupInformation?.TargetFrameworkName ?? "<NULL>") + "\""); str.AppendLine("} "); str.AppendLine(); return(str.ToString()); }