Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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_*********"
Posted

Try this CodeProject article:

Share User Settings Between Applications[^]

Edit: fixed link as quotes were being escaped
 
Share this answer
 
v2
Hi.

Thanks for sharing this with me!!

I probably should have mentioned that I'm pretty new to C# (and to computer programming in general) so to be honest I don't fully understand everything you have done in your project.

I can't seem to find the part where you get the user.config path anywhere, it looks to me like you specify your own user.config file, and your own path. Maybe I'm wrong......

Could you, based on my specific needs, point me in the right direction regarding your code?

Again, thanks for sharing your great article with me!
 
Share this answer
 
Comments
#realJSOP 26-Jun-10 16:46pm    
Ask the same question in the article's forum.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900