Skip to content

WebApplicationBuilder adds default services twice #33934

Closed
@davidfowl

Description

@davidfowl

After my change got merged Swashbuckle broke when using the WebApplicationBuilder and it's because we call ConfigureWebHostDefaults twice:

  1. _deferredHostBuilder.ConfigureWebHostDefaults(configure: _ => { });
  2. _hostBuilder.ConfigureWebHostDefaults(ConfigureWebHost);

Assuming it was fine to do so but it isn't when using API explorer because we end up adding the same provider twice which makes swashbuckle (and I assume other code) unhappy. Swagger/OpenAPI is currently broken because of this.

cc @halter73 @LadyNaggaga @bradygaster

Metadata

Metadata

Assignees

Labels

Priority:0Work that we can't release withoutarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbugThis issue describes a behavior which is not expected - a bug.feature-minimal-hosting

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions