Skip to content

Commit

Permalink
Merge pull request #1304 from nunit/issue-1300
Browse files Browse the repository at this point in the history
Use x86 dotnet install path when running an x86 test assembly
  • Loading branch information
CharliePoole committed Jan 11, 2023
2 parents abc8668 + 477990c commit 76330ac
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 76330ac

Please sign in to comment.