-1

I Have Researched this question on Google and i cant seem to fine a good answer, or perhaps i am just searching the wrong thing

I Know by default any project settings are stored in the User/AppData directory Is there anyway to make these setting be read from the same directory that the program runs from?

user3027738
  • 46
  • 1
  • 10
  • 1
    Are you talking about the user configuration file for your application or the user settings for your Visual Studio project? – bouvierr Mar 11 '14 at 12:53
  • End users don't have permissions to write to the Program Files directory (or the x86 variant on x64 systems), so you probably do want their preference to be saved to their profile. – Rowland Shaw Mar 11 '14 at 12:54
  • Check this http://msdn.microsoft.com/en-us/library/vstudio/34c29fes(v=vs.100).aspx – Prasanth V J Mar 11 '14 at 12:56
  • @RowlandShaw my program is in a folder in C drive always and the reason i want to use settings from this folder is because i am running my exe through a licensing program and every time i update i have to redo all the settings ex Server Name, Server Password – user3027738 Mar 11 '14 at 15:09
  • @bouvierr the settings like Server Name Server Password – user3027738 Mar 11 '14 at 15:10
  • @bouvierr Sorry im talking about user settings – user3027738 Mar 11 '14 at 18:27

1 Answers1

0

If you want the configuration settings to be read from the application directory, you should use the Application Configuration file. This is the myprogram.exe.config file. But note that these are not specific to a user. And you might have issues if the user doesn't have privileges to write to the file in the application's directory.

bouvierr
  • 3,563
  • 3
  • 27
  • 32
  • I thought about this and i do currently have this file in the directory, but it will not save settings to it, instead it creates it in the appdata , is there something i need to select in the project to make it default to this? – user3027738 Mar 11 '14 at 14:53