c# - How do I use the ASP.NET v5 Configuration in a Console App (Packaged)? -
the new configuration system in asp.net v6 lovely web apps i'd similar console app. unfortunately, couldn't quite figure out how so. first part seems straightforward:
var config = new configuration() .addjsonfile("config.json"); var services = new servicecollection(); services.configure<appsettings>(config.getsubkey(nameof(appsettings)));
unfortunately, haven't been able figure out balance of needed code. think optionsmanager needs invoked hydrated appsettings object can returned via optionmanager.options property, how 1 wires things up, don't have clue.
needless say, in regard appreciated...
Comments
Post a Comment