Link to home
Create AccountLog in
Avatar of willmrk
willmrk

asked on

How to use the RegistryPermission Class

I recently created an application which stores values in the registry. Just recently I found out that some users are having problems because when running the application it apparently crashes because it doesnt have the correct permission to access the registry (I dont have many details about the error yet, so I doint know if it crashed when reading or writing). I did a couple quick googles and yahoos and found info about the registrypermission class, but I cant find any straight forward description of how to use it.

All the examples that I see, create a new instance of a registrypermission object (passing a permission and a registry path into the constructor), but then never do anything with the object! Is this how its used? Does just creating an instance of this object allow the application to access that registry key?

If not, please explain!

Thanks in advance,
willmrk
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Are you dead set on using the Registry, and not writing XML files?

Bob
Avatar of willmrk
willmrk

ASKER

well, There are other applications that will use this information stored in the registry. The Applications aren't neccessarily running from the same directory.
Would you be able to get away with granting full trusting the assembly?

Bob
Avatar of willmrk

ASKER


Sorry for my ignorance, but what exactly does that mean?

the "granting full trusting"...

Is this a setting that would have to be done on the PC after the application is installed?
Or is this configured via the code in my application?
What implications does it have to "grant full trusting" of an assembly?

Thanks again for your assistance!
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer