[Mono-winforms-list] System.MissingMethodException -- get_DefaultFont!

Sebastien Pouliot sebastien at ximian.com
Tue Feb 27 21:21:08 EST 2007


Hey,

Well if it's not a reference mix up then you got a serious installation
problem. Just to be 100% sure can you try

monodis --assemblyref yourownproject.exe

to see what everything that is referenced by your project.

Sebastien

p.s. Please always c.c. the mailing-list in your answers. This way
Google can (or will) answer to same question next time ;-)

On Tue, 2007-02-27 at 21:06 -0500, Fleury wrote:
> My project uses all 2.0 references. Inaddition, I just now tried
> forcing the System.Windows.Forms to use the 1.x dll, but it seems to
> default to 2.0 -- curious, no? Nevertheless, all my references are
> from the GAC and are version 2.0.
> 
> I wish it was as simple as just mixed up dependencies... ;)
> 
> On 2/27/07, Sebastien Pouliot <sebastien at ximian.com> wrote:
>         Hello,
>         
>         System.Drawing.SystemFonts.DefaultFont exists since 2005 (but
>         it's a 2.0
>         class).
>         
>         I got the feeling you added a reference to 2.0
>         System.Windows.Forms.dll
>         (from the GAC path you provided) from a 1.x project (since you
>         said you
>         *tried* to target 2.0) - which is *bad*.
>         
>         Either use 1.1 or 2.0 for your projects but don't mix them
>         (and live an
>         happy life ;-)
>         
>         Sebastien
>         
>         On Tue, 2007-02-27 at 20:39 -0500, Fleury wrote:
>         > When trying to run even the most basic Windows Forms app on
>         Linux or 
>         > Mac (note: Windows works) I get this error message...
>         >
>         > ---------------------------------------------
>         >
>         > thevenin at Frostwinds:~$ mono
>         '/home/thevenin/Desktop/testme.exe'
>         >
>         > ** (/home/thevenin/Desktop/testme.exe:5767): WARNING **:
>         Missing
>         > method get_DefaultFont in
>         >
>         assembly /home/thevenin/mono-1.2.3.1/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll, type System.Drawing.SystemFonts
>         > Gtk colorscheme read failure, using built-in colorscheme
>         >
>         > Unhandled Exception: System.TypeInitializationException : An
>         exception
>         > was thrown by the type initializer for
>         > System.Windows.Forms.ThemeEngine --->
>         System.MissingMethodException:
>         > Method not found:
>         'System.Drawing.SystemFonts.get_DefaultFont '.
>         >   at <0x00000> <unknown method>
>         >   at System.Windows.Forms.ThemeWin32Classic..ctor ()
>         [0x00000]
>         >   at System.Windows.Forms.ThemeEngine..cctor () [0x00000]
>         --- End of
>         > inner exception stack trace --- 
>         >
>         >   at <0x00000> <unknown method>
>         >   at System.Windows.Forms.X11DesktopColors..cctor ()
>         [0x00000]
>         >
>         > -----------------------------------------------------------
>         >
>         > As you can see, I'm using mono-1.2.3.1, and of course
>         reference
>         > System.Windows.Forms from the GAC. I have tried setting
>         Sharp Develop
>         > to target platform Mono 2.0 and even NET 2.0, yet neither
>         resolve
>         > this. Any ideas?
>         > 
>         > I'm running the latest version of Ubuntu btw.
>         >
>         > _______________________________________________
>         > Mono-winforms-list
>         maillist  -  Mono-winforms-list at lists.ximian.com
>         > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>         --
>         Sebastien Pouliot  <sebastien at ximian.com>
>         Blog: http://pages.infinit.net/ctech/
>         
> 
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/



More information about the Mono-winforms-list mailing list