Imposible to read array of strings form appsettings.json in asp dot net 3.1
I’m trying to read some objects from appsettings.json. The json contains this structure:
I’m trying to read some objects from appsettings.json. The json contains this structure:
Before posting this question I have gone through multiple posts that are similar. My question focuses on “why is it happening despite applying the common and possibly right solution?”.
I’ve got some questions about two ways to save settings in the web.config. Appsettings: Look in web.config <appSettings> <add key=”key1″ value=”value1″/> <add key=”key2″ value=”value2″/> </appSettings> Usage in code-behind: ConfigurationManager.AppSettings["key1"]; ApplicationSettings/ Properties (autogenerated by using the ‘properties’-tab in the project) Look in web.config <applicationSettings> <Projectname.Properties.Settings> <setting name=”TestEnvironment” serializeAs=”String”> <value>True</value> </setting> </Projectname.Properties.Settings> </applicationSettings> Usage in code-behind: Properties.Settings.Default.TestEnvironment … Read more
I have a number of appSettings in web.config that are used frequently (i.e. on each post back). Does the ConfigurationManager hold these values in process or are there any performance gains to be had by copying these values into application state on ApplicationStart() and subsequently retrieving them from there?
I am using app.config file to read data from it..
I am loading the app.config file as: