When adding an app.manifest file to a .Net 6.0 WPF application, the app.manifest file contains the following commented:
Specifying requestedExecutionLevel element will disable file and registry virtualization. Remove this element if your application requires this virtualization for backwards compatibility.
followed by the following (not commented):
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
However, whether the requestedExecutionLevel is or is not commented has no effect. I tried both as a simple WPF application, and also with a Windows Application Packaging Project. After running the following:
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\test.txt";
File.Create(path);
and then opening C:\Users\MyUser\AppData\Local.
In a regular WPF project, test.txt always exists.
In a packaged project, it always doesn't.
So does requestedExecutionLevel have any effect? If so, when?