开发者

.NET application access denied to create a subfolder in AppData folder

开发者 https://www.devze.com 2023-04-13 05:11 出处:网络
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 pl

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

0

精彩评论

暂无评论...
验证码 换一张
取 消