Description
dotnet test is always setting the DOTNET_ROOT environment variable in the testhost.exe process. Before .NET 6, this was ignored in x86 processes with standard fxr resolver logic. Starting in .NET 6, the standard fxr resolver logic will use this location even if it is the wrong architecture.
Steps to reproduce
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<RollForward>Major</RollForward>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
</ItemGroup>
</Project>
Expected behavior
DOTNET_ROOT is not set in the testhost.exe process. DOTNET_ROOT_x64 may or may not be set.
Actual behavior
DOTNET_ROOT is set.
Further information can be found in dotnet/runtime#68180.
Description
Steps to reproduce
Expected behavior
Actual behavior
Further information can be found in dotnet/runtime#68180.