๐Ÿ˜œ

์ญˆ๋‚˜์•„๋น  ๋ธ”๋กœ๊ทธ

JUNA
STUDIO

[ASP.NET] Changing the ASP.Net core 6 Kestrel default hosting address and port

๋ฐœํ–‰์ผ: Feb, 2025
์กฐํšŒ์ˆ˜: 3
๋‹จ์–ด์ˆ˜: 64

Table of Contents


Method 1: Configure in appsettings.json

Add the following configuration to your appsettings.json file to define Kestrel endpoints:

{
  "Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://localhost:5000"
      },
      "Https": {
        "Url": "https://localhost:5001"
      }
    }
  }
}

Method 2: Define in Program.cs

You can also specify the endpoint directly in Program.cs:

await app.RunAsync("http://localhost:5000");

Further Reading

For more details, refer to the official Microsoft documentation:

Configure Endpoints in ASP.NET Core Kestrel Web Server


Tags: #ASP.NET Core#Kestrel#appsettings.json#Program.cs#Endpoint Configuration#HTTP#HTTPS
JUNA BLOG VISITORS
Today
7
 (
updown
-7
)
Total
657
 (
updown
+7
)

ยฉ 2025 juniyunapapa@gmail.com.