简体   繁体   English

Visual Studio for Mac 上的 .net-core3.1:无法配置 HTTPS 端点

[英].net-core3.1 on Visual Studio for Mac: Unable to configure HTTPS endpoint

On my Mac, Visual Studio throws this error when I try to run a .net core project.在我的 Mac 上,当我尝试运行 .net 核心项目时,Visual Studio 会引发此错误。

System.InvalidOperationException: "Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.\\nTo generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.\\nFor more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054." System.InvalidOperationException: "无法配置 HTTPS 端点。未指定服务器证书,并且无法找到默认开发人员证书或已过期。\\n要生成开发人员证书,请运行 'dotnet dev-certs https'。要信任证书(仅限 Windows 和 macOS)运行“dotnet dev-certs https --trust”。\\n有关配置 HTTPS 的详细信息,请参阅https://go.microsoft.com/fwlink/?linkid=848054。

Running: dotnet dev-certs https运行: dotnet dev-certs https

Returns:返回:

A valid HTTPS certificate with a key accessible across security partitions was not found.未找到具有可跨安全分区访问的密钥的有效 HTTPS 证书。 The following command will run to fix it: 'sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9' This command will make the certificate key accessible across security partitions and might prompt you for your password.将运行以下命令来修复它:'sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9' 此命令将使证书密钥跨安全分区访问,并可能提示您输入密码。 For more information see: https://aka.ms/aspnetcore/2.1/troubleshootcertissues A valid HTTPS certificate with a key accessible across security partitions was not found.有关详细信息,请参阅: https : //aka.ms/aspnetcore/2.1/troubleshootcertissues未找到具有跨安全分区可访问密钥的有效 HTTPS 证书。 The following command will run to fix it: 'sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9' This command will make the certificate key accessible across security partitions and might prompt you for your password.将运行以下命令来修复它:'sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9' 此命令将使证书密钥跨安全分区访问,并可能提示您输入密码。 For more information see: https://aka.ms/aspnetcore/3.1/troubleshootcertissues A valid HTTPS certificate is already present.有关详细信息,请参阅: https : //aka.ms/aspnetcore/3.1/troubleshootcertissues已存在有效的 HTTPS 证书。

Running: sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9运行: sudo security set-key-partition-list -D localhost -S unsigned:,teamid:UBF8T346G9

Prompts for two passwords:提示输入两个密码:

Password:密码:

password to unlock default:解锁密码默认:

and then returns:然后返回:

security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct.安全性:SecKeychainItemSetAccessWithPassword:您输入的用户名或密码不正确。

I have also deleted my localhost certificate and generated a new one.我还删除了我的localhost证书并生成了一个新证书。

What else should I try?我还应该尝试什么?

This worked for me :这对我有用:

  • Open Keychains打开钥匙扣
  • Click on System / Certificates单击系统/证书
  • find the cert for localhost找到本地主机的证书
  • right click and delete右键单击并删除
  • go to your terminal enter dotnet dev-certs https --trust转到您的终端输入 dotnet dev-certs https --trust

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 Visual Studio 2019 for Mac 上运行 .NET Core 3.1 测试项目 - Cannot run .NET Core 3.1 tests projects on Visual Studio 2019 for Mac .NET 核心 3 API,在 Mac 上使用 Visual Studio Code 开发:如何在 IIS 上部署和配置? - .NET core 3 API, develop on Mac with Visual Studio Code: how deploy and configure on IIS? 在Visual Studio for Mac和Asp.net Core 2.0 Web API中生成后无法运行解决方案 - Unable to run solution after build in Visual Studio for Mac and Asp.net Core 2.0 Web API Visual Studio For Mac .net Core 2.0 Ajax将模型传递给控制器 - Visual Studio For Mac .net Core 2.0 Ajax passing model to controller Visual Studio for Mac控制台应用程序.net Core 2命令行参数 - Visual Studio for Mac Console Application .net Core 2 command line arguments Visual Studio Preview for Mac 2017 .NET Core构建错误 - Visual Studio Preview for Mac 2017 .NET Core build error 适用于Mac的Visual Studio的Dot NET Core托管环境 - Dot NET Core Hosting Environment for Visual Studio for Mac 在.NET Core 2,Mac OS,使用MySQL的Visual Studio for Mac上:ArgumentOutOfRangeException:长度不能小于零 - On .NET Core 2, Mac OS, Visual Studio for Mac using MySQL: ArgumentOutOfRangeException: Length cannot be less than zero 在调试中为SSL配置launchSettings.json - ASP.NET Core / Visual Studio Code - Configure launchSettings.json for SSL in debug - ASP.NET Core / Visual Studio Code Visual Studio Mac与dotnet core 2不兼容 - Visual Studio Mac incompatible with dotnet core 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM