Skip to content

Commit

Permalink
Use x86 dotnet install path when running an x86 test assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Jan 11, 2023
1 parent abc8668 commit 477990c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ private static string GetDotNetInstallDirectory()
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Running on Windows so use registry
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\dotnet\SetUp\InstalledVersions\x64\sharedHost\");
RegistryKey key = Environment.Is64BitProcess
? Registry.LocalMachine.OpenSubKey(@"Software\dotnet\SetUp\InstalledVersions\x64\sharedHost\")
: Registry.LocalMachine.OpenSubKey(@"Software\dotnet\SetUp\InstalledVersions\x86\sharedHost\");
return (string)key?.GetValue("Path");
}
else
Expand Down

0 comments on commit 477990c

Please sign in to comment.