I've created a standard ASP.NET Core 9 Aspire application with all projects.
All work fine till I use localhost as endpoint for my web app, but obviously, I want to change to local lan IP (192.168.0.2 for example).
I've created the new self signed pfx and tried to use it - with no success:
builder.WebHost.ConfigureKestrel(serverOptions =>
{
serverOptions.ListenLocalhost(7507, listenOptions =>
{
listenOptions.UseHttps();
});
serverOptions.Listen(IPAddress.Parse("192.168.0.2"), 7507, listenOptions =>
{
listenOptions.UseHttps(@"d:\aspire.pfx", ".BigPassword2025");
});
serverOptions.Listen(IPAddress.Parse("127.0.0.1"), 7507, listenOptions =>
{
listenOptions.UseHttps();
});
});
builder.WebHost.ConfigureKestrel(serverOptions =>
{
serverOptions.ListenAnyIP(7507, listenOptions =>
{
listenOptions.UseHttps(@"d:\aspire.pfx", ".BigPassword2025");
});
});
I've also tried to use simple http with same port adding:
builder.WebHost.ConfigureKestrel(serverOptions =>
{
serverOptions.Listen(IPAddress.Parse("192.168.0.2"), 7508);
});
also with no success. AppHost can't find endpoints when launched.
Neither documentation nor AI has been able to help me.
I've read docs, asked AI & more