• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

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
0
willmrk
Asked:
willmrk
  • 3
  • 2
1 Solution
 
Bob LearnedCommented:
Are you dead set on using the Registry, and not writing XML files?

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

Bob
0
 
willmrkAuthor Commented:

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!
0
 
Bob LearnedCommented:
Applying a strong name to an assembly, and then trusting it through a policy:

Code Access Security
http://www.codeproject.com/dotnet/UB_CAS_NET.asp

Granting rights to the Intranet through a wizard:

.NET Framework Configuration Tool (Mscorcfg.msc)
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/cptools/html/cpconNETFrameworkAdministrationToolMscorcfgmsc.asp

Bob
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now