无法在 macOS Sierra 上恢复软件包 [英] Can't restore packages on macOS Sierra

查看:28
本文介绍了无法在 macOS Sierra 上恢复软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 .NET CORE 和 VSCode 在 Mac 上创建一个基本的 Web 应用程序 [无需成员资格和授权].

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

使用

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.

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

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

推荐答案

您没有按照 https://www.microsoft.com/net/core#macos,运行以下命令应该可以解决问题.

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

在我的电脑中,如果我卸载 OpenSSL,也会发生同样的错误.

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

这篇关于无法在 macOS Sierra 上恢复软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆