> I've got a program where I call a method in an internal class to update the
> registry. Something like this:
<snip>
> It doesn't work, however. VS complains that "assembly is not a valid
> attribute location for this declaration".
>
> Where do I put it then? I think I've tried all possible locations, but to no
> avail.
Put it outside the namespace declaration.
> Can anybody tell me what I'm doing wrong? I've done a lot of programs before
> that modifies the registry, and this is the first time I've run into a
> security problem, so I really don't know why it happens now when it hasn't
> happened before....
Are you running this program across the network by any chance? That's
the normal source of unexpected security issues.
Jon
Johnny Jörgensen - 28 Jan 2008 11:16 GMT
Stupid me. I just did:
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"bla\bla\bla");
and not:
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"bla\bla\bla", true);
Which makes the key readonly...
Problem solved, case closed - sorry for that...
Cheers,
/Johnny J.