Quantcast
Viewing all articles
Browse latest Browse all 15685

How Can I specify folder location for my ConfigurationManager MyApp.exe.config file?

My desktop application communicates with a external shortwave radio and can read and store specific station names and frequencies for future recall. I have been using Configuration manager to store station name 'keys' and their respective frequency 'values'. All works great but I want to give the user the opportunity to edit the XML config file when the program is not running if desired. When I use one step publishing the MyApp.exe.config file always winds up in some obscure user folder location, eg: C:\Users\me\AppData\Local\Apps\2.0\E0GDMH8J.2HT\E6T0A4C4.NX9. The documentation seems unnecessarily complex and convoluted.

My original declaration which worked well was:
Code:

Dim configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Someone suggested i use this instead:
Code:

Dim configFile = ConfigurationManager.OpenExeConfiguration(Application.StartupPath & "\MyApp.exe")
but that still winds up in an adjacent similar folder location.

Any advice appreciated

Viewing all articles
Browse latest Browse all 15685

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>