How to fix the error "Failed to load hostfxr.dll" but is found (0x80070057)?

Viewed 366

I've created a .net core 3.1 project, and published it as self contained. When I try run this on a box with .net framework 4.5 on, I get this error

Failed to load the dll from [C:\XXXX\hostfxr.dll], HRE SULT: 0x80070057 The library hostfxr.dll was found, but loading it from C:\xxxxx\hostfxr.dll failed - Installing .NET Core prerequisites might help resolve this problem. https://go.microsoft.com/fwlink/?linkid=798306

I was under the impression that self contained would resolve any of these dependencies? Is there any way to resolve this issue, without having to install a new .net Framework/Core ?

1 Answers

There seems to be a problem with Visual Studio. Closing down VS, deleting the bin and the obj folder, and only then starting up VS solves this problem.

Related