Reputation: 657
I have a small Winform aplication developed in VS 2010 and C#. And created setup also.
I have put application config file in the application folder path for saving user credentials. After the installation application can't access the config file because I given program installation default path as follows:
[ProgramFilesFolder][Manufacturer][ProductName]
So I need to keep my user credential somewhere else permanently. I need both read and write permissions. Also I need to log the application exceptions.
Upvotes: 3
Views: 4569
Reputation: 127543
The place you are supposed to save user data is in one of the following Environment.SpecialFolder locations
You get the path by using Enviorment.GetFolderPath
var savePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)),
"MyAppName");
//This should return the path %UserProfile%\Roaming\MyAppName\
For the programs logs I would use CommonApplicationData
so the logs from several users are all collected in one location.
Upvotes: 12