J
John Bowman
Hi All,
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....
[RegistryPermissionAttribute(SecurityAction.PermitOnly,
Read=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
[RegistryPermissionAttribute(SecurityAction.PermitOnly,
Write=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
This all works just fine on WinXP, but throws an exception under WinVista
Build: 5384:
"Request for the permission of type
'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0,
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
WinVista.
TIA,
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....
[RegistryPermissionAttribute(SecurityAction.PermitOnly,
Read=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
[RegistryPermissionAttribute(SecurityAction.PermitOnly,
Write=@"HKEY_LOCAL_MACHINE\Software\My Company Name"]
This all works just fine on WinXP, but throws an exception under WinVista
Build: 5384:
"Request for the permission of type
'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0,
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
WinVista.
TIA,