File location for config file to app installed to local user location

Posted by user54064 on Stack Overflow See other posts from Stack Overflow or by user54064
Published on 2010-04-29T23:06:46Z Indexed on 2010/04/29 23:27 UTC
Read the original article Hit count: 227

Filed under:
|

I have a WinForm app that has inside of the app's config file locations to find files for the app to use as it runs. However, the app will be installed locally for each user so it can't be hard coded. For Vista and Windows 7 the installer puts the app in c:\users\\Documents area. Under Windows XP it puts it in a different location. How can I write the config file to use some sort of placeholder to be filled in at runtime with the specific user's information? I am just using the default areas that Windows wants to install a per-user install but need the config file to be flexible at runtime for the specific user.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about configuration