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

2

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 ?

c#
.net-core
dll
asked on Stack Overflow Jan 26, 2021 by WynDiesel • edited Jan 26, 2021 by Olivier Rogier

1 Answer

0

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.

answered on Stack Overflow May 20, 2021 by WynDiesel

User contributions licensed under CC BY-SA 3.0