-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
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 abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When using minimal APIs in ASP.NET Core 6, after creating a new application from the existing app, the ServerFeatures property of the new application is null.
Per @Tratcher, this is because the ServerFeatures are never put in the property bag of the application:
aspnetcore/src/DefaultBuilder/src/WebApplication.cs
Lines 70 to 71 in d1c349f
| internal IFeatureCollection ServerFeatures => _host.Services.GetRequiredService<IServer>().Features; | |
| IFeatureCollection IApplicationBuilder.ServerFeatures => ServerFeatures; |
Expected Behavior
ServerFeatures shouldn't be null.
Steps To Reproduce
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var newApp = (app as IApplicationBuilder).New();
Debug.Assert(newApp.ServerFeatures != null);Exceptions (if any)
No response
.NET Version
6.0.100
Anything else?
No response
halter73, skyflyer and campersau
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 abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.