.net - 无法在 Windows 的 Visual Studio 代码中启动红隼
问题描述
这是我在做 dotnet run 时遇到的问题
暴击:Microsoft.AspNetCore.Server.Kestrel[0] 无法启动 Kestrel。System.InvalidOperationException:无法配置 HTTPS 端点。未指定服务器证书,默认开发人员证书找不到或已过期。要生成开发人员证书,请运行“dotnet dev-certs https”。要信任证书(仅限 Windows 和 macOS),请运行“dotnet dev-certs https --trust”。
有关配置 HTTPS 的更多信息,请参阅https://go.microsoft.com/fwlink/?linkid=848054。在 Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action 1 configureOptions) at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions) 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) 在 Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication1 application, CancellationToken cancellationToken) Unhandled exception. 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. 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) 在 Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context) 在 Microsoft.AspNetCore.Server.Kestrel.Core 的 Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions)。 Internal.AddressBinder.BindAsync(IServerAddressesFeature 地址,KestrelServerOptions serverOptions,ILogger 记录器,Func 2 createBinding) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication
1 应用程序,CancellationToken cancelToken)
在 Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancelToken) 在 Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancelToken) 在 Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) 在 Microsoft。 Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Microsoft.AspNetCore.Components.Web.DevServer.Commands.ServeCommand.Execute() at Microsoft.Extensions .CommandLineUtils.CommandLineApplication.Execute(String[] args) 在 Microsoft.AspNetCore.Components.WebAssembly.DevServer.Program.Main(String[] args)
解决方案
推荐阅读
- database - 如何提取和组合hive数据库中的特定数据表。发现一些错误
- asp.net - Asp.Net.Core 完全自定义
- javafx - 使用 Guice 4 的 createInjector() 时出现 InvocationTargetException
- python - 如何将变量保存到文件中(如打印但保存到文件中)?
- python - 为什么在除块之外的python中包含错误类型会减少运行时间?
- python - 自定义损失函数:NotImplementedError:无法将符号张量(truediv_2:0)转换为 numpy 数组
- sql - 用于返回分隔字符串不匹配的行的 SQL 表达式
- python-3.x - 我如何从 transfermarkt 上的玩家那里抓取多个国家/地区的图像并且仍然避免双重国籍?
- javascript - 我将如何使用 Discord.js 制作一个“主持活动”的机器人?
- python - 我试图了解神经网络训练中的“时代”。接下来的实验是否相同?