Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bitness from process or OS #2571

Merged
merged 1 commit into from Sep 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
Expand Up @@ -451,7 +451,19 @@ private bool UpdateRunSettingsIfRequired(string runsettingsXml, List<string> sou
|| chosenFramework.Name.IndexOf("netcoreapp", StringComparison.OrdinalIgnoreCase) >= 0
|| chosenFramework.Name.IndexOf("net5", StringComparison.OrdinalIgnoreCase) >= 0)
{
defaultArchitecture = Environment.Is64BitOperatingSystem ? Architecture.X64 : Architecture.X86;
#if NETCOREAPP
// We are running in vstest.console that is either started via dotnet.exe or via vstest.console.exe .NET Core
// executable. For AnyCPU dlls this should resolve 32-bit SDK when running from 32-bit dotnet process and
// 64-bit SDK when running from 64-bit dotnet process.
defaultArchitecture = Environment.Is64BitProcess ? Architecture.X64 : Architecture.X86;
#else
// We are running in vstest.console.exe that was built against .NET Framework. This console prefers 32-bit
// because it needs to run as 32-bit to be compatible with QTAgent. It runs as 32-bit both under VS and
// in Developer console. Set the default architecture based on the OS architecture, to find 64-bit dotnet SDK
// when running AnyCPU dll on 64-bit system, and 32-bit SDK when running AnyCPU dll on 32-bit OS.
// We want to find 64-bit SDK because it is more likely to be installed.
defaultArchitecture = Environment.Is64BitOperatingSystem ? Architecture.X64 : Architecture.X86;
#endif
}

settingsUpdated |= this.UpdatePlatform(document, navigator, sources, sourcePlatforms, defaultArchitecture, out Architecture chosenPlatform);
Expand Down