1

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

marc_s
760k186 gold badges1.4k silver badges1.5k bronze badges
asked Jun 26, 2025 at 9:04

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.