wimh / SparkleShare

SparkleShare is a file sharing and collaboration tool inspired by Dropbox.
http://www.sparkleshare.org/
GNU General Public License v3.0
39 stars 6 forks source link

TypeInitializationException at startup on Win7 x64 #3

Closed kalw closed 13 years ago

kalw commented 13 years ago

Hi there,

same workaround as #2, now i got the error you can see @ http://pastebin.com/Xn1xzfaU

wimh commented 13 years ago

Looks like the project must be converted to x86 as long as GTK# is still in use http://mono.1490590.n4.nabble.com/Gtk-on-the-NET-Framework-tp1546809p1546810.html

wimh commented 13 years ago

should be fixed in 7bf7059b3277473cd845a2329f60ee2c4ceef8be

kalw commented 13 years ago

Wow you're fast =) Sadly it seems to fail with a related error : #4

wimh commented 13 years ago

Looks like #4 (http://pastebin.com/nY9TWDWw) is exactly the same error. So I will reopen this one. I guess I will have to find a W7 x64 system to be able to reproduce this....

C:\projects\SparkleShare\SparkleShare\Windows>C:\projects\SparkleShare\bin\spark
leshare.exe
00:15:26 [SSH] ssh-agent started, PID=4432
00:15:26 [Config] Updated notifications:True
00:15:26 [Config] Updated "C:\Users\xxxx\AppData\Roaming\sparkleshare\config.xml"

Exception non gérée : System.TypeInitializationException: Une exception a été le
vée par l'initialiseur de type pour 'Gtk.Application'. ---> System.BadImageForma
tException: Tentative de chargement d'un programme de format incorrect. (Excepti
on de HRESULT : 0x8007000B)
   à GLib.Thread.glibsharp_g_thread_supported()
   à GLib.Thread.get_Supported()
   à Gtk.Application..cctor()
   --- Fin de la trace de la pile d'exception interne ---
   à Gtk.Application.Init()
   à SparkleShare.SparkleUI..ctor()
   à SparkleShare.SparkleShare.Main(String[] args)
wimh commented 13 years ago

I think I have found something, see What has changed between Windows XP and 7 that crashes my Mono C# application?. MonoDevelop does not set the 32bit flag properly. So the exacutable needs to be patched using CorFlags.exe. If it is not installed, you can check Where should I download corflags.exe from?.

When I run "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\CorFlags.exe" bin\SparkleShare.exe i see this:

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  3.5.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 3
ILONLY    : 1
32BIT     : 1
Signed    : 0

If 32BIT is not 1, it should be set using CorFlags.exe /32BIT+ bin\SparkleShare.exe.

kalw commented 13 years ago

Hey,

You're right again, it did the trick ! Thanks a lot for everyone.

Regards,

keamas commented 12 years ago

Hi I am using Windows 7 x64 and I downloaded http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3138 (Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1) I installed the component: "NET Development Tools" which contains the CorFlags.exe I found it under: C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\CorFlags.exe I followed this wiki https://github.com/wimh/SparkleShare/wiki

I did the following steps I hope I did it right please give me a feedback or help me with this...:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>CorFlags.exe C:\projects\SparkleShare\bin\SparkleShare.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved.

Version : v2.0.50727 CLR Header: 2.5 PE : PE32 CorFlags : 1 ILONLY : 1 32BIT : 0 Signed : 0

The 32BIT Flag was not set so I set this flag so I executed this command to set it:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>CorFlags.exe /32BIT+ C:\projects\SparkleShare\bin\SparkleShare.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved.

So now it is set:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>CorFlags.exe C:\projects\Sparkl eShare\bin\SparkleShare.exe Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved.

Version : v2.0.50727 CLR Header: 2.5 PE : PE32 CorFlags : 3 ILONLY : 1 32BIT : 1 Signed : 0

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>

But still the same failure see here

C:\projects\SparkleShare\bin>SparkleShare.exe 21:16:16 [SSH] ssh-agent started, PID=5656 21:16:16 [Config] Updated notifications:True 21:16:16 [Config] Updated "C:\Users\mmiersebach\AppData\Roaming\sparkleshare\con fig.xml"

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'libgtk-win 32-2.0-0.dll': The specified procedure could not be found. (Exception from HRESU LT: 0x8007007F) at Gtk.Application.gtk_init(Int32& argc, IntPtr& argv) at Gtk.Application.Init() at SparkleShare.SparkleUI..ctor() at SparkleShare.SparkleShare.Main(String[] args)

C:\projects\SparkleShare\bin> C:\projects\SparkleShare\bin> C:\projects\SparkleShare\bin>

wimh commented 12 years ago

@keamas

Searching for similar issues it looks like not having admin rights when installing gtk-sharp can cause this.

Can you check if libgtk-win32-2.0-0.dll is in c:\program files(x86)\gtksharp\2.12\bin? And if that directory is added to the path?

keamas commented 12 years ago

C:\Program Files (x86)\GtkSharp\2.12\bin\libgtk-win32-2.0-0.dll is present. I installed gtk-sharp-2.12.10.win32 as a admin. What do you mean with

And if that directory is added to the path?

How can I check it and fix it if necessary??

wimh commented 12 years ago

And if that directory is added to the path?

How can I check it and fix it if necessary??

Take a look at http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx (or http://www.itechtalk.com/thread3595.html)

The path environment variable is probably pretty long. Possibly at the end it should contain ;C:\Program Files (x86)\GtkSharp\2.12\bin, but somewhere in the middle is fine too. As long as there is a semicolon (;) to separate each part of the path. If it is not there, you can add it.

keamas commented 12 years ago

My Environment Variables for GTK lookes like that:

System variables

Variable name: GTK_BASEPATH Variable value: C:\Program Files (x86)\GtkSharp\2.12\

Variable name: Path C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;%systemroot%\idmu\common;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\GtkSharp\2.12\bin

It is curious I did no changes I just checkd all this and started it again and now I can start it whooo hoooo !!!

C:\Users\test>C:\projects\SparkleShare\bin\sparkleshare.exe 21:05:27 [SSH] ssh-agent started, PID=6120 21:05:28 [Config] Updated notifications:True 21:05:28 [Config] Updated "C:\Users\test\AppData\Roaming\sparkleshare\config.xml" (sparkleshare:7048): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_subpixbuf: assertion `src_x >= 0 && src_x + width <= src_pixbuf->width' failed

(sparkleshare:7048): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_subpixbuf: assertion `src_x >= 0 && src_x + width <= src_pixbuf->width' failed

(sparkleshare:7048): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_subpixbuf: assertion `src_x >= 0 && src_x + width <= src_pixbuf->width' failed

(sparkleshare:7048): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_subpixbuf: assertion `src_x >= 0 && src_x + width <= src_pixbuf->width' failed

But I can not connect to my github repo see this issue: https://github.com/wimh/SparkleShare/issues/7

wimh commented 12 years ago

It is curious I did no changes I just checkd all this and started it again and now I can start it whooo hoooo !!!

lol, good it is working now!!!

wimh commented 12 years ago

Maybe a reboot was required after the installation of gtk....

wimh commented 12 years ago

The current version no longer needs gtk. So it should be possible now to run on x64 without any hacks. But I did not try it yet.