[Mono-dev] Using an alternate System.Windows.Forms

Miguel de Icaza miguel at novell.com
Tue Feb 8 20:35:36 EST 2011


Hello Steve,

> I can “force” this to work by overwriting the System.Windows.Forms.dll with
> our custom one in the mono gac, but going that route would force us to
> distribute a custom mono package to our users which really doesn’t appeal to
> me.  As things currently run our users can always get the latest and
> greatest mono distribution and things continue to work.

You can override the GAC used by Mono by setting the MONO_GAC_PREFIX
environment variable.   You can set this from C before you init Mono,
and would let you say "Use this GAC before you try the System GAC"

char dir = g_string_concat (bundle_dir, "Contents/MyMonoPrefix", NULL);
setenv ("MONO_GAC_PREFIX", dir);

Then recreate the basic directory structure under Contents/MyMonoPrefix:

lib/mono/gac/System.Windows.Forms/XXXXX/System.Windows.Forms.dll

Miguel


More information about the Mono-devel-list mailing list