C# difference between Environment.SpecialFolders and Application folders
-
27-10-2019 - |
Question
What is the difference between the magic paths in these namespaces:
Environment.SpecialFolder.LocalApplicationData
versus
Application.LocalUserAppDataPath
And
Environment.SpecialFolder.ApplicationData
versus
Application.CommonAppDataPath
etc...
Solution
They are not the same. The Application version of them is aware of ClickOnce deployment, adjusting the paths accordingly to keep them isolated.
OTHER TIPS
On Windows 7:
Environment.SpecialFolder.LocalApplicationData = C:\Users\username\AppData\Local
Application.LocalUserAppDataPath = C:\Users\username\AppData\Local
Environment.SpecialFolder.ApplicationData = C:\Users\username\AppData\Roaming
Application.CommonAppDataPath = C:\Users\username\AppData\Roaming
Local is only ever stored on the local machine. Roaming is copied to the domain server (when in a domain) and is then loaded back onto other machines in that domain when you log on.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow