I had a few apps on my Win 7 which worked just fine, but on Win 8 they give me an error:
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
And that the access to the path was denied.
The part that crashes and gives me this error is when i try to delete a file from the HDD, while the program runs as admin:
File.Delete(files[minIndex].path);
I have read online to try and ask for administrator rights so I have created an "app.manifest" file and updated it to have:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
And confirmed that in the settings, the app manifest is set to this file, but it still gives me the same error (both in debug mode and when running the .exe). When looking at the file through explorer, I can modify it and delete it, so the user does have a permission.
What else can I try?