Update copyright year, improve documentation, upgrade to .NET 9.0, and refactor AspNetCore entry point.

This commit is contained in:
2025-07-28 03:20:21 +02:00
parent 97ceab3e1c
commit 6dc19e8bbd
9 changed files with 27 additions and 37 deletions

View File

@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Builder;
using VAR.WebFormsCore.AspNetCore.Code;
namespace VAR.WebFormsCore.AspNetCore;
public static class DefaultMain
{
public static void WebFormCoreMain(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseGlobalRouterMiddleware(builder.Environment);
app.Run();
}
}

View File

@@ -1,13 +0,0 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace VAR.WebFormsCore.AspNetCore;
public static class DefaultMain
{
public static void WebFormCoreMain(string[] args) { CreateHostBuilder(args).Build().Run(); }
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
}

View File

@@ -1,18 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.DependencyInjection;
using VAR.WebFormsCore.AspNetCore.Code;
namespace VAR.WebFormsCore.AspNetCore;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// If using Kestrel:
services.Configure<KestrelServerOptions>(options => { options.AddServerHeader = false; });
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseGlobalRouterMiddleware(env); }
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>