无论如何都无法在 mac 上设置 dotNet 证书

Failed to setup dotNet certificate on mac by all means

我正在尝试 运行 macOS 最新版本上的 Dotnet 版本 6 应用程序 我到处搜索,虽然我有一个有效的证书,但总是需要安装证书。

"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

我做了什么 1- 多次删除钥匙串。 2- 重新启动、关闭并重新安装 SDK 和 visual studio。 3- 证书测试 A valid HTTPS certificate is already present . 4- 我做了 dotnet dev-certs https --clean 然后 dotnet dev-certs https 然后 dotnet dev-certs https --trust A valid HTTPS certificate is already present.

并且仍然无法 运行 MVC 网络应用程序。错误再次发生。 任何想法将不胜感激

这是 KeyChain 从钥匙串中删除证书,然后从 visual studio 代码中删除 Run without Debugging,直到它需要钥匙串密码。然后就可以了