When I run my application as a NonAdmin user(a user who is a part of the
"Users" group), it throws an exception at a point in the code where
RijndaelManaged class is instantiated. Exception thrown is "Requested
registry access is not allowed". Any help wld be highly appreciated.

Re: RijndaelManaged class by Peter

Peter
Tue Jun 05 03:12:24 CDT 2007

On Tue, 05 Jun 2007 00:18:01 -0700, Vaibhav Goel
<VaibhavGoel@discussions.microsoft.com> wrote:

> When I run my application as a NonAdmin user(a user who is a part of the
> "Users" group), it throws an exception at a point in the code where
> RijndaelManaged class is instantiated. Exception thrown is "Requested
> registry access is not allowed". Any help wld be highly appreciated.

What kind of help are you expecting? The exception is pretty clear, and
the correct solution is to ensure that you in fact have the right security
access to the registry key you're trying to modify. Usually when an
application runs into something like this, it's because the application is
not intended for actually doing administrative things on the computer, but
is inappropriately trying to write data to administrative-related areas of
the registry.

You either need to fix the program so that it doesn't inappropriately
write to administrative-related areas of the registry, or make sure you
are running the program with the correct security privileges.

Pete

Re: RijndaelManaged class by Benny

Benny
Wed Jun 06 05:40:09 CDT 2007

Peter,

As i read the question, the exception is thrown when the RijndaelManaged
class is instatiated. This tells me that some registry key is accesed during
this process. Which? And if the RijndaelManaged class requieres acces to som
registry key when instantiating, how do you fix your program so it does not
requeire acces to that key?

Best regards,

Benny

"Peter Duniho" <NpOeStPeAdM@nnowslpianmk.com> skrev i en meddelelse
news:op.ttfvqykl8jd0ej@petes-computer.local...
> On Tue, 05 Jun 2007 00:18:01 -0700, Vaibhav Goel
> <VaibhavGoel@discussions.microsoft.com> wrote:
>
>> When I run my application as a NonAdmin user(a user who is a part of the
>> "Users" group), it throws an exception at a point in the code where
>> RijndaelManaged class is instantiated. Exception thrown is "Requested
>> registry access is not allowed". Any help wld be highly appreciated.
>
> What kind of help are you expecting? The exception is pretty clear, and
> the correct solution is to ensure that you in fact have the right security
> access to the registry key you're trying to modify. Usually when an
> application runs into something like this, it's because the application is
> not intended for actually doing administrative things on the computer, but
> is inappropriately trying to write data to administrative-related areas of
> the registry.
>
> You either need to fix the program so that it doesn't inappropriately
> write to administrative-related areas of the registry, or make sure you
> are running the program with the correct security privileges.
>
> Pete



Re: RijndaelManaged class by Benny

Benny
Wed Jun 06 05:42:36 CDT 2007

Could you post some code?

Benny


"Vaibhav Goel" <VaibhavGoel@discussions.microsoft.com> skrev i en meddelelse
news:35E44E65-80CE-4772-BFBB-F9282B328C41@microsoft.com...
> When I run my application as a NonAdmin user(a user who is a part of the
> "Users" group), it throws an exception at a point in the code where
> RijndaelManaged class is instantiated. Exception thrown is "Requested
> registry access is not allowed". Any help wld be highly appreciated.



Re: RijndaelManaged class by Peter

Peter
Wed Jun 06 12:08:30 CDT 2007

On Wed, 06 Jun 2007 03:40:09 -0700, Benny Skjold Tordrup <bst@visma.dk>
wrote:

> Peter,
>
> As i read the question, the exception is thrown when the RijndaelManaged
> class is instatiated. This tells me that some registry key is accesed
> during
> this process. Which?

I don't know. The OP didn't post a concise-but-complete example of code
that would consistently reproduce the problem, so it's not even possible
to say in this case unless you have specific knowledge of the workings of
that class. I don't.

However, someone debugging the code when the exception happens ought to be
able to.

> And if the RijndaelManaged class requieres acces to som
> registry key when instantiating, how do you fix your program so it does
> not requeire acces to that key?

Again, I don't know. Without knowing what the OP is doing that would
cause instantiating the object to try that registry access, it's not
possible for me to answer that question. There's only one constructor for
the RijndaelManaged class, and using it does not by default cause a
security-restricted registry access.

If the class requires that access, then the only fix is to either provide
a way for the user to elevate their privileges, or stop using the class in
a way that causes that attempt to access the registry (or stop using it
altogether, though presumably that's not a very good solution).

So, I'm still left wondering what sort of help the OP expects. No code
was posted, no suggestion as to why they are in this situation in the
first place. They *do* get an exception, and my experience has been that
when the code actually *stops* (exception, null reference, etc) it's
fairly easy to look at the current state of the program and figure out
what is wrong. But only the OP can do that.

Pete