[英].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 :这对我有用:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.