I asked this in the Vista dev support newsgroup but thought I might have
better luck here:
I've got a .Net 2.0 WinForms app that I've written for XP/2003. One of
things it does is use the OpenRemoteBaseKey on the RegistryKey class to
acces the registry of a remote machine. This works fine on XP/2003. However,
when I hit a Vista RC1 box with it, it fails with "Attempted to perform an
unauthorized operation."
I've tried attributing the assembly as a whole with the following:
[assembly: RegistryPermissionAttribute(SecurityAction.RequestMinimum, Read =
@"HKEY_LOCAL_MACHINE")]
But it did not seem to help. I suspect I'm missing something or is this a
new Vista security thing? Either way, work arounds?

Signature
Darren Mar-Elia
MS-MVP-Windows Server--Group Policy
http://www.gpoguy.com -- The Windows Group Policy Information Hub:
FAQs, Training Videos, Whitepapers and Utilities for all things Group
Policy-related
Group Policy Management solutions at http://www.sdmsoftware.com
Nicole Calinoiu - 23 Sep 2006 14:54 GMT
This sounds like a user permissions issue, not a CAS permissions issue, so
increasing your assembly's CAS permissions is unlikely to be of any help.
Are you sure your user account has sufficient permissions for accessing the
registry remotely on the Vista machine? What happens if you attempt to
connect via regedit?
BTW, adding an assembly-level RequestMinimum for a CAS permission doesn't
cause your assembly to be granted any additional permissions under normal
circumstances. It just results in your assembly failing to load if it isn't
granted the requested permission. If your assembly loads after you add a
RequestMinimum, it already had the permission(s) you requested. (The only
exception to this is if you're also using RequestOptional attributes, which
may have resulted in the implicit rejection of the permission you need.)
>I asked this in the Vista dev support newsgroup but thought I might have
>better luck here:
[quoted text clipped - 14 lines]
> But it did not seem to help. I suspect I'm missing something or is this a
> new Vista security thing? Either way, work arounds?
serge calderara - 28 Sep 2006 08:39 GMT
Hi,
I have read som article on Vista security stuff and they have drastically
improve system security by giving by default the least priviledge. If you try
to run an action whcih require administration level you will get a nice popup
windows that will informed you that you do nt have the rights to execute such
oiperation and in certain situation you will be able to enter the admin
credential.
That behaviour will affect most all application which was previoulsy runing
with high priviledge.
When you run your applciation under XP or 2000, with which user login were
you executing your applciation ?
> I asked this in the Vista dev support newsgroup but thought I might have
> better luck here:
[quoted text clipped - 12 lines]
> But it did not seem to help. I suspect I'm missing something or is this a
> new Vista security thing? Either way, work arounds?