I get this error when trying to delete a file on AppData\...
System.UnauthorizedAccessException: Access to the path '...AppData\Roaming\Mozilla\Firefox\Profiles\4peif3cq.default\extensions\om.brunolm@gmail.com.xpi' is denied.
if (File.Exists(extFile))
{
File.Delete(extFile);
}
I've tried to add FullControl
permission to Everyone
, but the same error happens. The file is not readonly
.
Why can't I delete this file with C# code? How can I delete it?