sdk: "The library hostfxr.dll was found, but loading it from C:\Program Files (x86)\dotnet\host\fxr\3.1.1\hostfxr.dll failed"

> >dotnet --list-sdks
> Failed to load the dll from [C:\Program Files (x86)\dotnet\host\fxr\3.1.1\hostfxr.dll], HRESULT: 0x800700C1
> The library hostfxr.dll was found, but loading it from C:\Program Files (x86)\dotnet\host\fxr\3.1.1\hostfxr.dll failed
> 
> Installing .NET Core prerequisites might help resolve this problem.
>      https://go.microsoft.com/fwlink/?linkid=798306

I’ve just installed both 64 and 32 bit version of 3.1.101 from https://dotnet.microsoft.com/download/dotnet-core/3.1

The 64 bit version is fine, however the 32 bit version gives the above message.

I’m on Windows 10 (1909, 18363.592), so I think I have all the pre-requisites (that is to say there are none).

How can fix this?

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

This is most definitely still an issue:

  • install .NET SDK 64-bit
  • install .NET SDK 32-bit
  • run an app targeting netcoreapp3.1 and compiled with PublishSingleFile
Failed to load the dll from [C:\Program Files (x86)\dotnet\host\fxr\6.0.0-rc.2.21480.5\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files (x86)\dotnet\host\fxr\6.0.0-rc.2.21480.5\hostfxr.dll failed

Why is it trying to load the x86 hostfxr? Shouldn’t it be trying the 64-bit one?

I get unexpected behaviors with hostfxr compiled for x86 but everything for x64 works like a dream!

I’m spinning up the host after injecting it into an active process.

on x64 inside of an x64 process, everything works great

on x86 inside of an x86 process, it works as intended every 1/20 times (probably has something to do with address spaces)

there’s something nutty going on with x86