我正在尝试使用 .NET CORE 和 VSCode 在 Mac 上创建一个基本 Web 应用程序 [无需成员(member)资格和授权]。
使用创建新项目后
yo aspnet
命令我尝试恢复应用程序文件夹中的包,但收到此错误:
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,也会发生同样的错误。
关于asp.net-core - 无法在 macOS Sierra 上恢复包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40819614/