无法在macOS Sierra上恢复软件包

时间:2016-11-26 14:54:32

标签: asp.net-core nuget visual-studio-code .net-core macos-sierra

我正在尝试使用.NET CORE和VSCode在Mac上创建一个Web应用程序基础[没有成员资格和授权]。

使用

创建新项目后
yo aspnet

命令我正在尝试恢复我的app文件夹中的包但是我收到了这个错误:

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)

1 个答案:

答案 0 :(得分:3)

您没有按照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,则会发生同样的错误。

相关问题