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

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

Open
johndaintree opened this issue Jan 29, 2020 · 15 comments

Comments

@johndaintree
Copy link

> >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?

@ClearScriptLib
Copy link

We're seeing the same issue on Windows 10 1903, affecting only the 32-bit version of .NET Core.

Strangely, it worked yesterday, but last night's Patch Tuesday reboot seems to have broken it.

@johndaintree
Copy link
Author

Seems to be ok now in 3.1.102.

@szszoke
Copy link

szszoke commented Mar 27, 2020

I have this issue as well. I am running Windows 10 1903 Build 18362.239.

I tried both with 3.1.200 and 3.1.201.

@minan61
Copy link

minan61 commented Mar 30, 2020

Same issue here, worked 10 mins ago, but got stuck on whatever reason

@adambarath
Copy link

By installing KB2533623 update will solve the problem for Windows 7 deployments: https://support.microsoft.com/en-gb/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot

@doghappy
Copy link

doghappy commented Nov 11, 2020

By installing KB2533623 update will solve the problem for Windows 7 deployments: https://support.microsoft.com/en-gb/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot

Today, I could not download it and got a 404 page. dotnet/docs#20459

@doghappy
Copy link

KB3063858 fixed the problem for me!

32-bit: https://www.microsoft.com/en-us/download/details.aspx?id=47409
64-bit: https://www.microsoft.com/en-us/download/details.aspx?id=47442

—— https://www.reddit.com/r/windows/comments/ik7sp7/does_anybody_have_the_kb2533623_update_for/

@aolszowka
Copy link

Getting burned by this in Windows Server 2019 (1809) Updates didn't seem to do much for me, did anyone figure out what the actual root cause for this is?

@ccornici
Copy link

Getting the same exact thing when creating a WPF APPX bundle, installing it and running it, the app just exits and in Event Viewer I got

Description: A .NET Core application failed.
Application: myapp.exe
Path:  C:\Program Files\WindowsApps\myapp\myapp.exe
Message: Failed to load the dll from [C:\Program Files\WindowsApp\myapp\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files\WindowsApp\myapp\hostfxr.dll failed
  - Installing .NET Core prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=798306

When I try building, installing & running a different app, which is also build on .NET Core 3.1 and uses similar nugets etc it runs without any issues

I tested on a different machine and the same issue happens.....

@ccornici
Copy link

I deleted the bin & obj folders from the projects and now it works, so I assume it's yet another VS 2019 bug....

@ccornici
Copy link

Now it doesn't work anymore again even after I delete the folders above :)

@confessore
Copy link

confessore commented Jun 18, 2021

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

@KirillOsenkov KirillOsenkov reopened this Oct 14, 2021
@KirillOsenkov
Copy link
Member

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?

@RaulSebastian
Copy link

RaulSebastian commented Nov 17, 2021

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?

got the same issue, this should be adressed

@NCLnclNCL
Copy link

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?

got the same issue, this should be adressed

yes it will errors if dotnet run -a x86 in dotnet runtime 64 bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests