.NET application access denied to create a subfolder in AppData folder
This has me a little bewildered at the moment. I have a .NET application which I have made an installer for via WIX 3.5. My app has some per-user files that it creates and uses during runtime so I am planning to create a \MyApp
subfolder in AppData.
var directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MyApp");
if(!Directory.Exists(directory)){
Directory.Create(directory);
}
However, this doesn't seem to work once the app is installed via the installer. Thoug开发者_运维问答hts?
instead of using the Environment.SpecialFolder.ApplicationData, use Environment.SpecialFolder.LocalApplicationData
精彩评论