asp.net-core - 无法在 macOS Sierra 上恢复包

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

我正在尝试使用 .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/

相关文章:

nuget - 为什么我的 NuGet Gallery 从 nuget 推送返回 500?

visual-studio-2015 - 持续警告 : "Multiple packages failed to uninstall."

visual-studio-code - 是否可以在 javascript 的字符串中使用 emmet 的 lorem?

c# - 通用接口(interface)、实现和依赖注入(inject) - 实现类型无法转换为服务类型

c# - 迁移到 .net core 2.0 session 后停止正常工作

c# - 如何在asp.net core中修改HttpContext.Request.Form

visual-studio-2010 - 通过单个命令通过 Nuget 安装多个包

node.js - codium + pcmanfm-qt == 70+ CWD 和 SIZE 每秒命令

go - 关于在vscode中安装gopls后弹出警告

c# - 如何在 ASP.NET 5 RC 1 中使用 JavaScriptSerializer?