[Mono-list] SecurityException at KeyHandler..ctor

Shunyata Kharg shunyata.kharg at gmail.com
Tue Nov 18 14:43:53 EST 2008


Hello!

I'm running the latest version of Mono 2.0.

In my application, I have a class library derived from
System.Windows.Forms.Control within a WinForm and the class library makes
calls to Microsoft.Win32.Registry.GetValue(). 

When it does so, I get the following error:

Unhandled Exception: System.Security.SecurityException: No access to the
given key
  at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey,
System.String basedir) [0x00000] 
  at Microsoft.Win32.KeyHandler.Lookup (Microsoft.Win32.RegistryKey rkey,
Boolean createNonExisting) [0x00000] 
  at Microsoft.Win32.UnixRegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey
rkey, System.String keyname, Boolean writable) [0x00000] 
  at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, Boolean
writable) [0x00000] 
  at (wrapper remoting-invoke-with-check)
Microsoft.Win32.RegistryKey:OpenSubKey (string,bool)
  at Microsoft.Win32.Registry.ToKey (System.String keyName, Boolean setting)
[0x00000] 
  at Microsoft.Win32.Registry.GetValue (System.String keyName, System.String
valueName, System.Object defaultValue) [0x00000] 

Using reflector, I can see the the KeyHandler constructor tries to emulate
the Win32 registry using xml files, so I think the code should work.
However, I don't know how to get around the SecurityException. Has anybody
got any ideas please?

Thank you!
-- 
View this message in context: http://www.nabble.com/SecurityException-at-KeyHandler..ctor-tp20564934p20564934.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list