I know this topis was already discussed in the newsgroup,
but I can't find any conclusions. The problem is that
when I try to use RegistryKey.DeleteSubKeyTree, it throws
an UnauthorizedAccessException. I'am a local
administrator on my machine, and the .NET framework
configuration has not been changed since install time.
The code snippet is as follows:
RegistryKey CLSIDKey = Registry.ClassesRoot.OpenSubKey
RegistryPermission regPerm = new RegistryPermission
(RegistryPermissionAccess.Write, CLSIDKey.Name + "\\" +
catch (Exception e)
Console.WriteLine ("Can't delete CLSID " + ourGUID + "
from registry. Details:" + e);
The output is:
Can't delete CLSID from registry.
Details:System.UnauthorizedAccessException: Cannot write
to the registry key.
at Registrar.Main(String args)
Does anybody know what's the problem? How does the
correct code look like?
Thanks in advance.
Archived from group: microsoft>public>dotnet>security