dev-certs 生成无根证书

dev-certs generate cert with no root

我的 OS 是 ubuntu 18.04

没有 sudo 不起作用

$ dotnet dev-certs https
There was an error saving the HTTPS developer certificate to the current user personal certificate store.

如果我使用

$ sudo dotnet dev-certs https

好的,但我只得到 运行 一个没有 sudo 的 mvc 程序

crit: Microsoft.AspNetCore.Server.Kestrel[0]
      Unable to start Kestrel.
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.

我解决了这个问题。 我删除文件夹 .aspnet .dotnet 和 .nuget 回复 运行 dotnet dev-certs https