Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between 'SpecialFolder.LocalApplicationData' and 'SpecialFolder.ApplicationData'?

On my system, %AppData% leads to ApplicationData which is C:\Users\<USER>\AppData\Roaming

But there is also C:\Users\<USER>\AppData\Local
And for some more confusion D:\Users\<USER>\AppData\LocalLow

string local = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 

My question is, to which of these locations should my application save its data?

Are there guidelines for which of these locations to use? And am I leaving myself open to problems if I choose the wrong location?

like image 743
Tarion Avatar asked Mar 14 '12 19:03

Tarion


People also ask

What is LocalApplicationData?

LocalApplicationData. 28. The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user.

What is environment SpecialFolder CommonApplicationData?

Environment. SpecialFolder. ApplicationData is the most common one. This folder holds per-user, non-temporary application-specific data, other than user documents. A common example would be a settings or configuration file.

Where is LocalApplicationData?

On Vista, ApplicationData is C:\Users\name\AppData\Roaming and LocalApplicationData is C:\Users\name\AppData\Local.


2 Answers

The Roaming folder is copied between machines when roaming profiles are enabled (in a domain environment). Use it for application data that you want to share between machines. But don't store large files in there -- IT departments don't like it when you do that, and it increases the time taken for the user to log in and to log out as the files are copied around.

The Local folder is not copied between machines. Use it for application data that's specific to a machine.

The LocalLow folder is used for low-privilege tasks (such as Internet Explorer). You shouldn't need to worry about it.

For files that the user specifically saved, you should put them (by default) in the Documents folder.

like image 50
Roger Lipscombe Avatar answered Oct 23 '22 19:10

Roger Lipscombe


According to MSDN the difference is that LocalApplicationData stays on the local machine and does not roam... ApplicationData does roam for example if the user logs onto the domain from a different computer it will be synced...

The LocalLow refers to specific situations likea BHO running in "Protected Mode" of IE...

For a standard application always use ApplicationData. Use LocalApplicationData for things that should NOT roam with the user...

like image 44
Yahia Avatar answered Oct 23 '22 19:10

Yahia