-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Obsolete KestrelServer (just the public type, not all of Kestrel!) #47686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Click-bait title! 🤣 |
I tried to make it less click bait. |
Probably. But assuming |
Given that the project is in maintenance mode, I'd be inclined to let it keep working "by accident" (though calling |
So what's the process here? Create an API issue suggesting we add the attribute? |
We already treat it as obsolete, adding the attribute seems fine. I don't think an API issue is warranted. I'll just put the labels on this one. |
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
I think the workaround for anyone using I also agree we should keep it working. There's no reason to rename the real Kestrel
I think it's still worth filling out the API proposal template. I'll do it though. Background and MotivationSee primary issue. Proposed APInamespace Microsoft.AspNetCore.Server.Kestrel.Core;
+ [Obsolete]
public class KestrelServer : IServer
{
} Usage ExamplesOld usages of // Before (now obsolete)
var kestrelOptions = new KestrelServerOptions();
// ...
var server = new KestrelServer(
Options.Create(kestrelOptions),
new SocketTransportFactory(Options.Create(new SocketTransportOptions()), new LoggerFactory()),
new LoggerFactory());
// After
var server = new HostBuilder().ConfigureWebHost(webBuilder =>
{
webBuilder.UseKestrel(kestrelOptions =>
{
// ...
}
}).Build().Services.GetRequiredService<IServer>();
// Usage of IServer vs KestrelServer should be the same. Alternative Designs
Risks
|
API Review Notes:
Blocked on #27213. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Kestrel is designed for DI. But there is a public way to create it directly: KestrelServer.cs
This is forcing various hacks on us:
IServer
is internal -KestrelServerImpl
- and is wrapped byKestrelServer
.KestrelServer
passes them toKestrelServerImpl
. See metrics PR and Andrew's TLS PR.KestrelServer
doesn't support HTTP/3 (no ctor overload was added for specifying multiplexed transports).Prior art in this area:
IISHttpServer
is internal.MessagePump
is internal.TestServer
is public.I think we should obsolete
KestrelServer
and require creating it with a builder.The text was updated successfully, but these errors were encountered: