From 6a110f7f8df6e8e24eebbfc2ea3e14037047e44d Mon Sep 17 00:00:00 2001 From: Vladimir Pecanac Date: Tue, 1 Dec 2026 00:23:09 +0100 Subject: [PATCH] HowToSetupDeveloperHttpsCertificate: move to .NET 11 and built-in OpenAPI Target net11.0, Microsoft.AspNetCore.OpenApi 11.0.0, Swashbuckle removed in favour of AddOpenApi and MapOpenApi. Launch profiles use ports 7175 and 5199 to match the article, launch URL weatherforecast, IIS Express settings dropped like the current webapi template. --- ...HowToSetupDeveloperHttpsCertificate.csproj | 5 ++-- .../Program.cs | 8 +++---- .../Properties/launchSettings.json | 24 ++++--------------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate.csproj b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate.csproj index d324660332..424b588a67 100644 --- a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate.csproj +++ b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate.csproj @@ -1,14 +1,13 @@ - net7.0 + net11.0 enable enable - - + diff --git a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Program.cs b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Program.cs index 48863a6d6c..666a9c543c 100644 --- a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Program.cs +++ b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Program.cs @@ -3,17 +3,15 @@ // Add services to the container. builder.Services.AddControllers(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); +// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi +builder.Services.AddOpenApi(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(); + app.MapOpenApi(); } app.UseHttpsRedirection(); diff --git a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Properties/launchSettings.json b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Properties/launchSettings.json index 740a481257..7ddbec9ebe 100644 --- a/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Properties/launchSettings.json +++ b/aspnetcore-features/HowToSetupDeveloperHttpsCertificate/HowToSetupDeveloperHttpsCertificate/Properties/launchSettings.json @@ -1,20 +1,12 @@ { "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:40250", - "sslPort": 44379 - } - }, "profiles": { "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:5018", + "launchUrl": "weatherforecast", + "applicationUrl": "http://localhost:5199", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -23,16 +15,8 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7073;http://localhost:5018", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "weatherforecast", + "applicationUrl": "https://localhost:7175;http://localhost:5199", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }