[Mono-dev] Gtk depends on Winforms ¿?

Andoni Morales ylatuya at gmail.com
Fri Sep 4 18:53:01 EDT 2009


Hi,

I have recently tried to upgrade  from Mono 2.4 to 2.4.2.2 in Windows
XP, which comes with gtk-sharp-2.12.9
In Windows I use 'mkbundle' [1] 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
output)
My aplication does not depends on Winforms and using Mono 2.4 I can
launch it without any problems. But  when I use Mono 2.4.2.2 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=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. The
system cannot find the file specified.
File name: 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
  at System.AppDomain.Load (System.String assemblyString,
System.Security.Policy.Evidence assemblySecurity, Boolean refonly)
[0x00000]
  at System.AppDomain.Load (System.String assemblyString) [0x00000]
  at (wrapper remoting-invoke-with-check) System.AppDomain:Load (string)
  at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000]
  at Gtk.Application..cctor () [0x00000]
  --- End of inner exception stack trace ---
  at ChronoJump..ctor (System.String[] args) [0x00000]
  at ChronoJump.Main (System.String[] args) [0x00000]

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 2.4.2.3 so I believe it's a gtk-sharp issue

In the meanwhile,I have switched back to 2.4 and gtk-sharp 2.12.7
hoping that somebody can give an explanation ;)

Cheers
Andoni Morales Alastruey

[1] http://git.gnome.org/cgit/chronojump/tree/build/windows_bundle/build/makeBundle.sh
-------------- next part --------------
$ sh makeBundle.sh 
OS is: Windows
Sources: 1 Auto-dependencies: True
   embedding: c:\chronojump\build\Chronojump.exe
   embedding: c:\Mono-2.4\lib\mono\2.0\mscorlib.dll
   embedding: c:\Mono-2.4\lib\mono\gac\glade-sharp\2.12.0.0__35e10195dab3c99f\glade-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\gac\glib-sharp\2.12.0.0__35e10195dab3c99f\glib-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Configuration.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Xml.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Security.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Security.dll
   embedding: c:\Mono-2.4\lib\mono\gac\gdk-sharp\2.12.0.0__35e10195dab3c99f\gdk-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\gac\pango-sharp\2.12.0.0__35e10195dab3c99f\pango-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Cairo.dll
   embedding: c:\Mono-2.4\lib\mono\gac\gtk-sharp\2.12.0.0__35e10195dab3c99f\gtk-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\gac\atk-sharp\2.12.0.0__35e10195dab3c99f\atk-sharp.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Posix.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Data.Sqlite.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Data.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Data.Tds.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Transactions.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.EnterpriseServices.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Web.Services.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Web.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Drawing.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Web.dll
Compiling:
as -o temp.o temp.s 
OS is: Windows
Sources: 1 Auto-dependencies: True
   embedding: c:\chronojump\build\Chronojump_Mini.exe
   embedding: c:\Mono-2.4\lib\mono\2.0\mscorlib.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Posix.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Configuration.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Xml.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\System.Security.dll
   embedding: c:\Mono-2.4\lib\mono\2.0\Mono.Security.dll
Compiling:
as -o temp.o temp.s 


More information about the Mono-devel-list mailing list