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.
User contributions licensed under CC BY-SA 3.0