I've got an app I need to modifiy that's written in C# VS2005/.NET 2.0 which
is dsigned to ONLY run when the logged in user has administrator privileges.
At one point it needs to delete a HKLM\Software\... registry value if it
has, in fact, created it. So there is a method that deletes this registry
key. The method has the following RegistryPermission attributes....
Read=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
Write=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
This all works just fine on WinXP, but throws an exception under WinVista
"Request for the permission of type
'System.Security.Permissions.UIPermission, mscorlib, Version=184.108.40.206,
Culture=neutral, PublicKey Token=b77a5c561934e089' failed."
I'm fairly new to security stuff under .NET. Has something changed in
WinVista as compared to WinXPSP2 that would be expected to cause this or is
this a known issue WinVista? What can I do to work around it? I'm NOT
allowed to move the setting to HKCU\Software\My Company Name" since other
programs rely upon it being there while this app is running and they will
NOT necessarily be changing to run under
John C. Bowman
Thermo Electron Scientific Instruments Div.
<Remove this before reply> firstname.lastname@example.org