In a WinUI 3 packaged application, I am trying to create a folder in AppData\Local\MyApp
. In my application startup I am doing the following:
public App()
{
string apf = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string fp = Path.Combine(apf, "MyApp");
Directory.CreateDirectory(fp);
}
This does not create any directory in AppData/Local.
When I run this:
public App()
{
string apf = KnownFolders.GetPath(KnownFolder.AppData);
string fp = Path.Combine(apf, "MyApp");
Directory.CreateDirectory(fp);
}
A directory called "MyApp" is created in AppData\LocalLow which is not what I'm looking for. Any thoughts on what I may be doing wrong?