dotnet / dotnet/aspnetcore

Modify startup assemblies using the minimal hosting model

Open
#38,765 12 comments 1 reaction 1 assignee Claimed by @halter73 View on GitHub
area-minimal feature-minimal-hosting
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.