无法在 macOS Sierra 上恢复包

Can't restore packages on macOS Sierra

我正在尝试使用 .NET CORE 和 VSCode.

在 Mac 上创建一个基础 Web 应用程序 [没有成员资格和授权]

使用

创建新项目后
yo aspnet

command 我正在尝试恢复我的应用程序文件夹中的包,但出现此错误:

log  : Restoring packages for /Users/<user_name>/<app_name>/project.json...
error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
error:   The type initializer for 'System.Net.Http.CurlHandler' threw an exception.
error:   The type initializer for 'Http' threw an exception.
error:   The type initializer for 'HttpInitializer' threw an exception.
error:   The type initializer for 'CryptoInitializer' threw an exception.
error:   Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl': The specified module could not be found.
error:    (Exception from HRESULT: 0x8007007E)
Done: 1.

(我已经安装了所有依赖项和工具以在 mac 上执行 ASP.NET)

您没有按照 https://www.microsoft.com/net/core#macos 教程中的说明安装 OpenSSL,运行 下面的命令应该可以解决问题。

brew update; brew install openssl; mkdir -p /usr/local/lib; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/;

在我的电脑中,如果我卸载 OpenSSL,也会出现同样的错误。