【发布时间】:2022-01-07 15:15:26
【问题描述】:
当我运行我的镜像 docker 时,他给了我这个错误
Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.InvalidOperationException: HTTPS endpoints can only be configured using KestrelServerOptions.Listen().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAddressAsync(String address, AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, List`1 listenOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
Unhandled Exception: System.InvalidOperationException: HTTPS endpoints can only be configured using KestrelServerOptions.Listen().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAddressAsync(String address, AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, List`1 listenOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at Btorport.Web.Program.Main(String[] args) in /App/Btorport.Web/Program.cs:line 13
我认为证书有问题,所以我删除并在我的项目中通过执行此命令从新添加-->
dotnet dev-certs https --clean
dotnet dev-certs https
dotnet dev-certs https --trust
但是我没有在我的项目中使用 kestrul 我不知道为什么给我这个错误??
&这是我的 BuildWebHost 方法
return WebHost.CreateDefaultBuilder(args)
.UseUrls("http://*:5050;https://*:5050")
.UseStartup<Startup>()
.Build();
【问题讨论】: