Gtk# on the .NET Framework

View: New views
4 Messages — Rating Filter:   Alert me  

Gtk# on the .NET Framework

by no.human.being :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mono community.

Just wanted to get into Gtk#, since it looks so much better than SWF and feels much more mature and standard-compliant.

However I could not get it to run on the .NET Framework. I use Visual Studio 2008 to compile my binaries and use Gtk# from C#. The .NET Compiler compiles flawlessly and I can run the resulting executable using the Mono runtime (tested on version 2.4.2.3). However, the compiled .NET assembly does not execute on the .NET CLR. Even the following simple code is not running on .NET. When run in "debug" mode, it throws a "System.TypeInitializationException" when the Init() method of Gtk is called. When run in "release" mode, the .NET CLR crashes hard with a protection fault.

class Test
{
   static void Main(string[] args)
   {
      Gtk.Application.Init();
   }
}

What am I doing wrong? Is Gtk# even supposed to work on .NET or is it Mono-specific? The .NET binding as well as Gtk+ itself are installed on the system and working with the Mono runtime. Operating system is Vista x64.

Thanks.

Re: Gtk# on the .NET Framework

by Stifu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

It should work. There is an 8 MB install for Windows, which is available here:
http://ftp.novell.com/pub/mono/gtk-sharp/gtk-sharp-2.12.9-2.win32.msi

no.human.being wrote:
Hello Mono community.

Just wanted to get into Gtk#, since it looks so much better than SWF and feels much more mature and standard-compliant.

However I could not get it to run on the .NET Framework. I use Visual Studio 2008 to compile my binaries and use Gtk# from C#. The .NET Compiler compiles flawlessly and I can run the resulting executable using the Mono runtime (tested on version 2.4.2.3). However, the compiled .NET assembly does not execute on the .NET CLR. Even the following simple code is not running on .NET. When run in "debug" mode, it throws a "System.TypeInitializationException" when the Init() method of Gtk is called. When run in "release" mode, the .NET CLR crashes hard with a protection fault.

class Test
{
   static void Main(string[] args)
   {
      Gtk.Application.Init();
   }
}

What am I doing wrong? Is Gtk# even supposed to work on .NET or is it Mono-specific? The .NET binding as well as Gtk+ itself are installed on the system and working with the Mono runtime. Operating system is Vista x64.

Thanks.

Re: Gtk# on the .NET Framework

by no.human.being :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

thanks for your reply.

The msi you mentioned is already installed. As fas as I know you can't even add the "gtk-sharp" reference to your VS project without it. Native GTK+ applications work flawlessly on the systems and so do GTK# applications when run using mono. GTK# applications will also compile using the c-sharp compiler which comes with the .NET framework. The compiled assembly just won't execute using the .NET runtime, but it will do so on the Mono runtime.

Andre.


Hello,

It should work. There is an 8 MB install for Windows, which is available here:
http://ftp.novell.com/pub/mono/gtk-sharp/gtk-sharp-2.12.9-2.win32.msi

no.human.being wrote:
Hello Mono community.

Just wanted to get into Gtk#, since it looks so much better than SWF and feels much more mature and standard-compliant.

However I could not get it to run on the .NET Framework. I use Visual Studio 2008 to compile my binaries and use Gtk# from C#. The .NET Compiler compiles flawlessly and I can run the resulting executable using the Mono runtime (tested on version 2.4.2.3). However, the compiled .NET assembly does not execute on the .NET CLR. Even the following simple code is not running on .NET. When run in "debug" mode, it throws a "System.TypeInitializationException" when the Init() method of Gtk is called. When run in "release" mode, the .NET CLR crashes hard with a protection fault.

class Test
{
   static void Main(string[] args)
   {
      Gtk.Application.Init();
   }
}

What am I doing wrong? Is Gtk# even supposed to work on .NET or is it Mono-specific? The .NET binding as well as Gtk+ itself are installed on the system and working with the Mono runtime. Operating system is Vista x64.

Thanks.


Re: Gtk# on the .NET Framework

by Mohsenme :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I have a x64 windows, too. When you install Microsoft Visual Studio on a x64 windows, it installs a x64 version of DotNet Framework beside a x86 version. By Default the projects you create are set to work on x64 version of DotNet Framework. But gtksharp assembly is a x86 one, so you have to set the "Solution Platforms" combobox in standard toolbar to "x86" instead of "Any CPU".
For doing this, just select "Configuration Manager..." in "Solution Platforms" combobox in standard toolbar. In the dialog box opened, for "Active Solution Platform" select "New...", and in the new dialog box opened, select "x86" instead of "Itanium" for new platform combobox. Confirming two dialog boxes, everything's ok.

Just wanted to get into Gtk#, since it looks so much better than SWF and feels much more mature and standard-compliant.

However I could not get it to run on the .NET Framework. I use Visual Studio 2008 to compile my binaries and use Gtk# from C#. The .NET Compiler compiles flawlessly and I can run the resulting executable using the Mono runtime (tested on version 2.4.2.3). However, the compiled .NET assembly does not execute on the .NET CLR. Even the following simple code is not running on .NET. When run in "debug" mode, it throws a "System.TypeInitializationException" when the Init() method of Gtk is called. When run in "release" mode, the .NET CLR crashes hard with a protection fault.

class Test
{
   static void Main(string[] args)
   {
      Gtk.Application.Init();
   }
}

What am I doing wrong? Is Gtk# even supposed to work on .NET or is it Mono-specific? The .NET binding as well as Gtk+ itself are installed on the system and working with the Mono runtime. Operating system is Vista x64.

Thanks.