Can't restore packages on macOS Sierra

非 Y 不嫁゛ 提交于 2020-01-04 10:40:03

问题


I'm trying to create a Web Application Basic [without Membership and Authorization] on Mac using .NET CORE and VSCode.

After creating a new project using

yo aspnet

command I'm trying to restore packages in my app folder but I get this error:

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.

(I've already installed all dependencies and tools to execute ASP.NET on mac)


回答1:


You did not install the OpenSSL as described in the tutorial at https://www.microsoft.com/net/core#macos, running the command below should resolve the issue.

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/;

In my computer, if I uninstall the OpenSSL, the same error happens.



来源:https://stackoverflow.com/questions/40819614/cant-restore-packages-on-macos-sierra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!