Geeks With Blogs
Oh my god ... not another MS CRM blog Guenter vs. MSCRM

In the MSCRM 3.0 SDK there is sample code for callouts (Server Programming Guide\Business Logic Extensions (Callouts)\Callout Samples\Source Code Samples). In the code sample, the install directory path of the MS CRM web application is retrieved from the registry to get access to a configuration file. But there seems to be a little problem with this code sample. If you use it as it is, you probably get a SecurityException stating that "Requested registry access is not allowed". To avoid this you should change

RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\MSCRM", true);


RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\MSCRM", false);

The difference is that in the second version, the key is retrieved as read-only.

Thanks to my colleague Maik for bringing this up!

Posted on Thursday, February 16, 2006 7:40 AM | Back to top

Comments on this post: Retrieving registry values from callout - SecurityException

# re: Retrieving registry values from callout - SecurityException
Requesting Gravatar...
Thanks. I just ran into this issue.
Left by waterskier on Apr 25, 2006 5:04 PM

Your comment:
 (will show your gravatar)

Copyright © Guenter Wallnoefer | Powered by: