Skip to content

With NET 5 RC1 x86 SDK installed on x64 OS, run Unit test failed with error: Testhost process exited with error: A fatal error occurred, the required library hostfxr.dll could not be found... #13157

Closed
microsoft/vstest
#2571
@vdanche

Description

@vdanche

Machine OS: win10-x64
Repro Steps
Install NET 5 RC1 x86 SDK from https://github.com/dotnet/installer on x64 OS
dotnet new xunint/mstest/nunit in CLI
dotnet build and then dotnet test

Expected result:
Unit test run successfully

Actual result:
run failed with below error:
image
Testhost process exited with error: A fatal error occurred, the required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [C:\Users\v-danche\today\hahah\bin\Debug\net5.0].
If this is a framework-dependent application, install the runtime in the default location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location.
. Please check the diagnostic logs for more information.

Test Run Aborted.
C:\Program Files (x86)\dotnet\sdk\5.0.100-rc.1.20427.1\Microsoft.TestPlatform.targets(32,5): error MSB4181: The "Microsoft.TestPlatform.Build.Tasks.VSTestTask" task returned false but did not log an error. [C:\Users\v-danche\today\hahah\hahah.csproj]

Note:
It doesn't repro on x64 SDK.

It only repro on NET 5 RC1 x86.

Dotnet --info:
.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.1.20427.1
Commit: dd2e854

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x86
Base Path: C:\Program Files (x86)\dotnet\sdk\5.0.100-rc.1.20427.1\

Host (useful for support):
Version: 5.0.0-rc.1.20426.10
Commit: bfc00e4e13

.NET SDKs installed:
5.0.100-rc.1.20427.1 [C:\Program Files (x86)\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-rc.1.20426.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-rc.1.20426.10 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.0-rc.1.20426.4 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions