I've got app in .net core 5. And this is the code in Startup.cs
'''''
public static IHostBuilder CreateHostBuilder(string[] args) =>
//Host.CreateDefaultBuilder(args)
// .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
webBuilder
.UseStartup<Startup>()
.UseKestrel(o =>
{
o.Listen(IPAddress.Any, 443, opt =>
{
opt.UseHttps("pathfto.pfx", "passwordtocert");
});
});
});
I would like to take upgrade it to .net core 6
I thought that it would be like this
var builder = WebApplication.CreateBuilder(args);
builder.Host
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseKestrel(o =>
{
o.Listen(IPAddress.Any, 443, opt => { opt.UseHttps("pathto.pfx", "passwordtocert"); });
});
});
But it doesn't work when I try compile it.
Thank you in advance for any solutions.