我有:IDE:JB Rider 2019.3
操作系统:EndeavourOS(Arch Linux)
点网2.2
尝试运行空的 ASP.NET Core 项目时,出现错误:
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'. For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
据我了解,dotnet 对证书发誓,因此我为 localhost 创建了一个自签名 ssl 证书,但这并没有解决问题。
如何修复此错误?
PS 关于操作系统 - 接受 ubuntu 的决定。我将尝试使它们适应我的操作系统。
PSS 在排气管中还有这条线:
Unhandled Exception: 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'.

您可以尝试像这样修复它(很可能您的工具不在 PATH 中):
dotnet tool uninstall --global dotnet-dev-certs.dotnet tool install --global dotnet-dev-certs,它很可能会显示您的工具不在 PATH 中。例如:export PATH="$PATH:/root/.dotnet/tools"(仅限正确地址)dotnet dev-certs https