[Mono-list] SecurityException at KeyHandler..ctor

Robert Jordan robertj at gmx.net
Tue Nov 18 14:59:20 EST 2008

Shunyata Kharg wrote:
> 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

Your app is probably accessing HKEY_LOCAL_MACHINE which is mapped
to $prefix/etc/mono/registry/. This dir is usually not writable
by non-root. Note that even GetValue is touching the file system.

You can change this path by setting the env var MONO_REGISTRY_PATH
to a directory the current user full access for.


More information about the Mono-list mailing list