-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I would like to start and stop our application on demand, without exiting the process. Code would be similar like:
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseHttpSys();
builder.Services.AddControllers();
var app = builder.Build();
await app.StartAsync();
await app.StopAsync();
// Something here
await app.StartAsync();
However, with http.sys this gives an exception: Microsoft.AspNetCore.Server.HttpSys.HttpSysException: 'The prefix 'http://localhost:5074/' is already registered.'
.
Minimum testcase: WebApplication2.zip
Is there any way to restart the app or a workaround to make this work?
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
9.0.102
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions