[Mono-devel-list] Mono/Gtk# in Windows

Francisco T. Martinez martinf at mfconsulting.com
Wed Sep 15 07:55:16 EDT 2004


A lot of folks have been asking recently how and where to use what 
installer.  For a lot of us who use IRC, it may be a good thing to look 
over my notes below and -- correct me if necessary -- later spread the 
word about this.  I hope this helps.

If you want to use Visual Studio .NET 2003 to build Gtk# applications 
that will run without having Mono installed in your system. Use:

http://forge.novell.com/modules/xfmod/project/?gtks-inst4win

If you don't have Visual Studio .NET 2003 but want to code using your 
favorite editor and perhaps nmake (a Make tool specifically design for 
Windows).  You need to *FIRST* install the Microsoft .NET Framework 1.1 
SDK.  This is available here (watch out for URL wrapping):

http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en

Then you install the Gtk# Win32 installer for the MS .NET Framework SDK 
1.1 available here:

http://forge.novell.com/modules/xfmod/project/?gtks-inst4win

Using the software components described above, you could use csc.exe -- 
that is the C# compiler supplied by Microsoft -- to build your 
executable and/or library module assemblies.  If it is an executable, 
you could run it from the command line by just simply specifying the 
fully qualified path to the resulting exe file.

Since Mono is just awesome, you could take that same executable archive 
it into a zip file, copy it  to a Linux or Mac OS X computer configured 
to run Mono/Gtk# and run it there using a command line similar to this:

  mono ~/bin/MyGuiApp.exe

The Mono runtime will use the Just In Time (JIT) compilation technology 
and turn it int native code which will give it the best performance 
during execution.  There are times when you are targeting a new type of 
hardware (like a new CPU) that may not have JIT available yet but may 
already be supported by mint.  In such case you can use a command line 
like this:

  mint ~/bin/MyGuiApp.exe

The Mono interpreter (mint.exe) will be able to interpret the 
intermediate language (IL) that is enclosed in your file and run it as 
appropriate in accordance with the local machine's runtime knowledge of 
the underlying operating system and hardware.

--------------------------------------------------------------------------------------

If you just want to be able to run applications you have already 
compiled in Linux while you are on a Windows machine, you could try the 
Mono Combined installer.  You should be able to build/run your Gtk# 
application you compiled in Linux -- provided you don't have GNOME 
dependencies -- in Windows without any other piece of Microsoft supplied 
software.  The latest Mono combined installer is available here:

http://forge.novell.com/modules/xfmod/project/?monowin32

Having the Microsoft .NET Framework and/or SDK installed in your 
computer prior to the Mono Combined installer or afterward should not 
matter. The Mono Combined installer does not interact with the Microsoft 
.NET Framework.  It has its own Global Assembly Cache (GAC) and it is 
not placed on the system PATH during the installation -- This is by design.

A very common scenario has a developer who has developed an application 
using Mono.  THE ACID TEST IS: IF YOU USED MCS.EXE TO COMPILE YOUR 
PROGRAM PLEASE LISTEN.  That developer would then take his/her resulting 
binary output (e.g. MyApp.exe) and could run it on a Windows computer 
that had the Mono combined installer by going to the Start Menu of that 
computer and opening the Mono 1.0.1 Command Prompt.  This will spawn a 
console session that is at that point configured correctly with a Mono 
runtime environment.  Just as you would on a Linux shell (Bash or Tcsh) 
you could then run you application by type a command line similar to this:

C:\>mono d:\PacoBin\MyApp.exe

Paco
PS
I have done quite a bit of postings in my blog relating to these details 
in the past.  You may find more information and additional links there:
http://www.mfconsulting.com/blog






More information about the Mono-devel-list mailing list