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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -