I have the .NET SDK installed on my Windows laptop and am able to run a simple C# HelloWorld program.
.Net is installed at C:\Program Files\dotnet
and I also have that set in my PATH
variable.
I'm now trying to run another .NET application. It's run with an exe but all I can see is a cmd windo quickly flash on the screen. The following error is in my Event Viewer:
Description: A .NET Core application failed.
Application: Cdi.FinancialCalculator.Api.exe
Path: C:\workspace\DataInsights\content\di.Calculator.Api.exe
Message: 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:\workspace\DataInsights\content\].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files (x86)\dotnet] or use the DOTNET_ROOT(x86) environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation].
The .NET Core runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x86&rid=win10-x86
It's like this application is looking for the .NET runtime in the wrong location. How do I resolve this?
UPDATE
I added the DOTNET_CORE(x86)
environment variable with the value c:\Program Files\dotnet
. When I now run my application I get this error:
Description: A .NET Core application failed.
Application: di.Calculator.Api.exe
Path: C:\Workspace\DataInsights\content\di.FinancialCalculator.Api.exe
Message: Failed to load the dll from [C:\Program Files\dotnet\host\fxr\3.1.3\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\host\fxr\3.1.3\hostfxr.dll failed
- Installing .NET Core prerequisites might help resolve this problem.
https://go.microsoft.com/fwlink/?linkid=798306
I've seen different posts stating that installing KB2533623
resolved the issue for Windows 7 but I'm on Windows 10 where this doesn't seem to be applicible. Can anybody help resolve this?
I removed DOTNET_CORE(x86)
and installed the 32 bit runtime.
User contributions licensed under CC BY-SA 3.0