From 4905f366c2d37e7669a9022c021f3b370278c463 Mon Sep 17 00:00:00 2001 From: Anipik Date: Wed, 11 Apr 2018 14:53:01 -0700 Subject: [PATCH] using local machine --- .../src/System/Diagnostics/SharedUtils.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs b/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs index 9ddb161e0413..3d20b23b2dcc 100644 --- a/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs +++ b/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs @@ -163,7 +163,11 @@ internal static string GetLatestBuildDllDirectory(string machineName) try { - baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machineName); + if (machineName == ".") + baseKey = Registry.LocalMachine; + else + baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machineName); + if (baseKey == null) throw new InvalidOperationException(SR.Format(SR.RegKeyMissingShort, "HKEY_LOCAL_MACHINE", machineName));