无法在 Mac 上创建开发者证书 [英] Cannot create developer certificate on Mac

查看:23
本文介绍了无法在 Mac 上创建开发者证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这发生在一夜之间.昨天我能够在我的 .NET Core we 应用程序上工作.现在,每次我尝试执行 dotnet run 时,我的 cmd 行都会出现以下错误:

This happened overnight. Yesterday I was able to work on my .NET Core we application. Now every time I try to do a dotnet run I get the following error in my cmd line:

如您所见,我尝试运行建议的命令来创建开发人员证书,该证书是 dotnet dev-certs https,然后是 dotnet dev-certs https --trust.运行它们,我得到

As you can see, I tried running the suggested commands to create a developer certificate which are dotnet dev-certs https and then dotnet dev-certs https --trust. Running both of them, I get

将 HTTPS 开发者证书保存到当前用户个人证书存储时出错.

There was an error saving the HTTPS developer certificate to the current user personal certificate store.

在我运行这些命令之前,我在这个页面上读到我有两个在我的钥匙串中竞争本地主机认证.所以我进入钥匙串删除其中一个无济于事.然后我删除了另一个认为我可以以某种方式重新创建它的想法.因此我运行了上面的命令.

Before I ran those commands, I read on this page that I had two competing localhost certifications in my Keychain. So I go in the keychain to delete one of them to no avail. I then delete the other thinking that I can recreate it somehow. Hence me running the commands above.

然后我发现对于命令 dotnet dev-certs https [options] 选项(选项可以发现运行 dotnet dev-certs https -h

I then found out that I get the same "There was an error saving the HTTPS..." error for most variations of the command dotnet dev-certs https [options] options (options can be found running dotnet dev-certs https -h

有人知道我为什么会收到这个错误吗?我怎样才能获得更多关于为什么它不能保存到证书存储"的信息?好像我被拒绝访问某种文件夹.

Anyone know why I might be getting this error? How can I get more info as to why it's not able to save to the "certificate store"? It seems like I'm being denied access to some kind of folder.

推荐答案

好的,所以我终于重新启动了我的电脑.当我在 VS Code 中运行 dotnet run 命令时,出现了一些提示,要求我输入密码以允许钥匙串中的某些东西访问......某些东西.我应该截图....我的错.当我输入密码时,我收到了同样的错误.我再次按照步骤通过在初始问题中输入 dotnet 命令来创建开发认证.然后我第二次运行 dotnet run 和 viola.它有效.

Ok, so I finally just restarted my computer. When I ran the dotnet run command in VS Code, some prompt came up asking me for my password to allow something in keychain to get access to....something. I should taken a screenshot....my bad. When I put in my password, I received the same error. I, again, followed the steps to create a dev certification by entering the dotnet commands in the initial question. Then I ran dotnet run a second time and viola. It works.

不知道发生了什么.如果有人能提供一些见解,那就太棒了.

No idea what happened. If anyone can provide some insight then that would be awesome.

如果您遇到同样的问题,请尝试重新启动计算机并按照这些提示进行操作.

If you're experiencing the same problem, then try restarting your computer and following those prompts.

这篇关于无法在 Mac 上创建开发者证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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