[Mono-dev] Gtk depends on Winforms ¿?
christian_hoff at gmx.net
Sat Sep 5 03:15:47 EDT 2009
Andoni Morales wrote:
> I have recently tried to upgrade from Mono 2.4 to 184.108.40.206 in Windows
> XP, which comes with gtk-sharp-2.12.9
> In Windows I use 'mkbundle'  to generate from my c# app an
> executable file that can be launched on a computer that doesn't not
> have mono installed. mkbundle builds a new executable that embeds all
> the assemblies needed by the c# executable to run.(I attach the
> My aplication does not depends on Winforms and using Mono 2.4 I can
> launch it without any problems. But when I use Mono 220.127.116.11 I run
> into this exception:
> Unhandled Exception: System.TypeInitializationException: An exception
> was thrown by the type initializer for Gtk.Application --->
> System.IO.FileNotFoundException: Could not load file or assembly
> 'System.Windows.Forms, Version=18.104.22.168, Culture=neutral,
> PublicKeyToken=b77a5c561934e089' or one of its dependencies. The
> system cannot find the file specified.
> File name: 'System.Windows.Forms, Version=22.214.171.124, Culture=neutral,
> Does that means that with gtk-sharp-2.12.9 I need System.Windows.Forms
> to run a Gtk app? Why does Gtk.Application has a runtime dependency on
> System.Windows.Forms and why mkbundle is not even aware of this
> dependency and does not include this assembly in the bundle?
> It also happens with 126.96.36.199 so I believe it's a gtk-sharp issue
You're right. gtk-sharp has a Winforms dependency on the Windows
platform to enable visual styles by calling
System.Windows.Forms.Application.DoEvents via reflection. Nobody has
ever found out why this works or how we could implement such
functionality without loading winforms.
We should probably put that code in a try-block. What do you think, Mike?
More information about the Mono-devel-list