I have this code that creates, check the existence, deletes, etc a file:
string _myFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "MyFile.txt");
Debug.Print(_myFilePath);// C:\Users\leode\AppData\Local\MyFile.txt
Debug.Print(File.Exists(_myFilePath).ToString());// False
File.Create(_myFilePath).Close();
Debug.Print(File.Exists(_myFilePath).ToString());// True
File.Delete(_myFilePath);
Debug.Print(File.Exists(_myFilePath).ToString());// False
When I run it, the file is not created in LocalApplicationData directory (in my case "C:\Users\userName\AppData\Local\"), but in a different subdirectory that I found doing a search with the windows file explorer (in my case this subfolder was "C:\Users\userName\AppData\Local\Packages\F0C6F5FC-4B4B-478D-958D-BAD69252637E_9zz4h110yvjzm\LocalCache\Local").
The program runs correctly, but How can I get this real directory where File.Create(), File.Exists() and File.Delete() are interacting with "MyFile.txt"?