I'd incorporated a feature to receive email on getting unhandled exceptions in my c# program. I'd created a manifest file so that the program was getting administrative privileges via UAC when being run on Vista or 7.
However, i was surprised to see the error report showing System.UnauthorizedAccessException
when creating(opening a key for write access) and i'm absolutely puzzled on how to fix it.
Here's more information:
registry key"HKEY_CURRENT_USER \ Control Panel \ Desktop".
in Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
in Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity) in Microsoft.Win32.RegistryKey.CreateSubKey(String
I use the first overload of CreatedSubKey , eg. RegistryKey r=regkey.CreateSubKey("Desktop");