-
-
Notifications
You must be signed in to change notification settings - Fork 80
Description
The problem
Currently the HostBuilderExtensions.UseNetDaemonAppSettings function both configures the ServiceCollection and adds the Configuration sources that netdaemon uses by default. I would like to use the default/ my own configuration providers and not use the "HostbuilderExtensions.UseNetDaemonAppSettings" function. However because it both configure's the service collection and adds the providers I need to manually add the 2 lines in the ConfigureServices (https://github.com/net-daemon/netdaemon/blob/main/src/Runtime/NetDaemon.Runtime/Common/Extensions/HostBuilderExtensions.cs#L15-L16).
The proposed solution
Add an extension method on IServiceCollection that adds those 2 dependancies. This new method can be called from the existing HostbuilderExtensions.UseNetDaemonAppSettings to maintain backwards compatibility while allowing a single spot to add dependancies needed for the app. Therefore if someone chooses to manually set up the config providers they do not need to keep up on adding dependancies when changes are made in the future.
The alternatives
When someone wants to manually set up the config providers they have to manually add these 2 (and keep up with any changes in the UseNetDaemonAppSettings function).
Additional context
I would be happy to make the changes and PR if we like the idea.