I want to know which *.config file the ConfigurationManager is using. How can I figure that out?
For instance, you could be changing working directories and execute libraries from various paths. I'd love to have a way to display something like "Reading AppSettings from c:\MyApp\app.config" in my Trace.
The appsettings. json file is an application configuration file used to store configuration settings such as database connections strings, any application scope global variables, etc.
The file is stored inside this path "bin/debug/app. config", if you make changes while debugging, those changes should appear there. Just remember that this file is overwritten with the "app. config" from the project root each time you run the application on Visual Studio IDE.
The <appSettings> element stores custom application configuration information, such as database connection strings, file paths, XML Web service URLs, or any other custom configuration information for an application.
it is a .net builtin mechanism to define some settings before the application starts, without recompiling. see msdn configurationmanager.
In Solution Explorer, right-click the project node, and then select Add > New Item. The Add New Item dialog box appears. Expand Installed > Visual C# Items. In the middle pane, select the Application Configuration File template.
System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).FilePath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With