我在MacOS上使用.net核心处理Web应用程序。当我试图运行时
dotnet restore
在终端中,它会抛出一个错误
log : Restoring packages for /Users/saber/code/aspnet/WebA/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)
好像我没有正确链接OpenSSL。
如果我跑:
brew install openssl
我会得到:
Warning: openssl-1.0.2j already installed, it's just not linked.
和
$ ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
如果我运行
ln: /usr/local/lib//libcrypto.1.0.0.dylib: File exists
$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln: /usr/local/lib//libssl.1.0.0.dylib: File exists
which openssl
,它给了我:/usr/bin/openssl
任何人都可以帮助解决这种情况吗?