在cmd中执行.NET命令时,DLL加载失败

时间:2018-12-17 13:06:25

标签: c# .net

我在此站点中看到了类似的问题,但是该解决方案对我不起作用。我在笔记本电脑(Windows 7)中下载了.NET SDK 2.2.10安装程序,安装成功后,每当我尝试在cmd上执行与.NET相关的任何命令时,它都会显示以下错误:

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>

当我只键入dotnet时,它显示以下说明:

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.

为什么此DLL无法正确加载? 解决此问题后,如何从命令行编译c#程序? 预先谢谢你。

0 个答案:

没有答案