1

I have seen a similar question in this site, but the solution for that did not work for me. I downloaded the .NET SDK 2.2.10 installer in my laptop( Windows 7) and after successful installation whenever I try to execute any command related to .NET on cmd, it shows the following error:

C:\Users\USER>dotnet --help
Failed to load the DLL from [C:\Program Files\dotnet\host\fxr\2.2.0\hostfxr.dll]
, HRESULT: 0x80070057
The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\h
ost\fxr\2.2.0\hostfxr.dll failed
  - Installing .NET Core prerequisites might help resolve this problem.
     http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

C:\Users\USER>

When I just type dotnet, it shows the following instructions:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\USER>dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET Core information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.

Why is this DLL not being loaded properly? After resolving this issue, how to compile c# programs from the command line? Thank you in advance.

bugfreerammohan
  • 1,471
  • 1
  • 7
  • 22
Ricky
  • 635
  • 2
  • 5
  • 20
  • 2
    Did you follow this advice already: *Installing .NET Core prerequisites might help resolve this problem.* – rene Dec 17 '18 at 13:08
  • 1
    What are the prerequisites? Where should I install them from? – Ricky Dec 17 '18 at 13:09
  • 1
    There is a link directly under that message: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 – rene Dec 17 '18 at 13:10
  • It's not coming, can you post it in the comment? – Ricky Dec 17 '18 at 13:15
  • here: https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2.0/2.2.0-download.md and your OS is Windows 7, SP1 right? – rene Dec 17 '18 at 13:19
  • Thank You and YES – Ricky Dec 17 '18 at 13:20
  • Might be an duplicate of: https://stackoverflow.com/questions/51777065/failed-to-load-hostfxr-dll – rene Dec 17 '18 at 13:21
  • 1
    Even after installing all dependencies, it's showing same error! – Ricky Dec 17 '18 at 13:33
  • And no pending Windows Updates that needs to be installed? – rene Dec 17 '18 at 13:36
  • or another dupe with answers: https://stackoverflow.com/questions/50644730/failed-to-load-the-hostfxr-dll-after-install-net-core – rene Dec 17 '18 at 14:02
  • 1
    Win7 is rapidly turning into the new XP. Do run Windows Update first. And check with IT staff, they may intentionally prevent updates from getting deployed. – Hans Passant Dec 17 '18 at 14:11

0 Answers0