Skip to content

Modify startup assemblies using the minimal hosting model #38765

@nfplee

Description

@nfplee

Is there a way to modify the startup assemblies using the minimal hosting model?

In ASP.NET Core 5 I would say the following (where hostBuilder is an instance of IWebHostBuilder):

hostBuilder.UseSetting(WebHostDefaults.HostingStartupAssembliesKey, string.Join(";", assemblies));

With the new minimal hosting model I tried saying:

builder.WebHost.UseSetting(WebHostDefaults.HostingStartupAssembliesKey, string.Join(";", assemblies));

However this throws a NotSupportedException and that I should use WebApplication.CreateBuilder(WebApplicationOptions) instead, but I can't see an option to specify the hosting startup assemblies.

Metadata

Metadata

Assignees

Labels

area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hosting

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions