Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which file is System.Configuration.ConfigurationManager.AppSettings using?

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.

like image 873
Larsenal Avatar asked Jan 27 '09 17:01

Larsenal


People also ask

What is appSettings file?

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.

Where are app config files stored?

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.

What is the appSettings section in the web config file?

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.

What is ConfigurationManager appSettings?

it is a .net builtin mechanism to define some settings before the application starts, without recompiling. see msdn configurationmanager.

Where is app config file in C#?

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.


1 Answers

System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).FilePath
like image 146
David Morton Avatar answered Nov 20 '22 02:11

David Morton