Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How can I get the user.config file path programmatically in a non-Clickonce app?

If you want to get to the path programmatically, you can do it using the Configuration Management API. For example, here is how you can get the local user.config file path:

Note: You need to add a reference to System.Configuration.dll

Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
Console.WriteLine("Local user config path: {0}", config.FilePath);


Page view counter