Allow loading of external ServiceDefaults
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 201
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
It would be good to externalize the ServiceDefaults as an assembly that is dynamically loaded; similar to using the ASPNETCORE_HOSTINGSTARTUPASSEMBLIES. This would allow the external (packages/container) to load the shared ServiceDefaults without having to modify the (package/container) or have complex configuration switches.
### Describe the solution you'd like
AppHost
```
var _defaults1=builder.AddServiceDefaults(name:"");
or
builder.AddServiceDefaults(name:"enhanced", "assemblyPath",[optional]string hash)
builder.AddSomePackage()
.WithServiceDefaults(_defaults1)
.WithServiceDefaults("enhanced")
```
This assembly would implement a interface something like `IConfigureServiceDefaults`
### Additional context
_No response_
Contributor guide
Research direction
Start by tracing the AppHost AddServiceDefaults entry point and reviewing how ASPNETCORE_HOSTINGSTARTUPASSEMBLIES supports dynamic loading. Define the loading and selection behavior for external ServiceDefaults assemblies, including the proposed IConfigureServiceDefaults contract, and verify that packages can use the named defaults without modifying their containers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100