Accessing other projects "user.config" file
-
Hi all! I have another post about this issue, but I will try to explain myself a bit better this time (sorry for posting 2 times) since the previous post did not get any attention! Here's the situation: I have a WinForms project called WinFormsProj1. I have several settings in this project which are saved in a "user.config" file (which lies in "C:\Users\Kåre Tragethon\AppData\Local\WinFormsProj1\WinFormsProj1.exe_Url_********\VersionNo\user.config"). From my main application (WinFormsProj1) I can find the path of the "user.config" by:
Configuration _usrConfigLoc = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
And then
string _filePath = _userConfigLoc.FilePath;
In the same solution I also have another project called WinFormsProj2. I want to access the user.config file to WinFormsProj1 from my WinFormsProj2 project. How can I find the file path? I must point out that the path I am looking for is NOT the "C:\Program Files\WinFormsProj1......"!! I am looking for the path of the user.config file which lies in "C:\Users\The User\AppData\Local\AppName\AppName.exe_Url_*********"
-
Hi all! I have another post about this issue, but I will try to explain myself a bit better this time (sorry for posting 2 times) since the previous post did not get any attention! Here's the situation: I have a WinForms project called WinFormsProj1. I have several settings in this project which are saved in a "user.config" file (which lies in "C:\Users\Kåre Tragethon\AppData\Local\WinFormsProj1\WinFormsProj1.exe_Url_********\VersionNo\user.config"). From my main application (WinFormsProj1) I can find the path of the "user.config" by:
Configuration _usrConfigLoc = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
And then
string _filePath = _userConfigLoc.FilePath;
In the same solution I also have another project called WinFormsProj2. I want to access the user.config file to WinFormsProj1 from my WinFormsProj2 project. How can I find the file path? I must point out that the path I am looking for is NOT the "C:\Program Files\WinFormsProj1......"!! I am looking for the path of the user.config file which lies in "C:\Users\The User\AppData\Local\AppName\AppName.exe_Url_*********"
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)