[Mono-dev] Building Mono on Windows - And Having a Windows Installer again

Alex J Lennon ajlennon at dynamicdevices.co.uk
Fri Nov 28 13:29:29 UTC 2014

Hi Daniel,

On 30/11/2014 02:13, Edward Ned Harvey (mono) wrote:
>> From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
>> bounces at lists.ximian.com] On Behalf Of Daniel Morgan
>> I see the latest version of Mono's Windows installer is 3.2.3.  Can this be used
>> to build the latest from git?
>> I see a link for binaries for 3.4.0, but they are not official binaries.
>> I am going to try build Mono on Windows using Cygwin.  Not sure how web
>> the visual studio stuff works.
> Search this list for Appveyor.  I know Alex Lennon was putting some effort in, and I think got to the point of having a reliable automated build process - but check with folks to be sure (I haven't followed very closely and I could be wrong).  At some point, Miguel pulled Duncan Mak into the conversation, so I would guess maybe Duncan is involved with distributing windows builds...  All of this occurred within the last ~ 1 month or so.

As Edward says, I did put a bit of time into this and we do have what I
think is a reliable automated build process on the Windows platform,
although as ever there are improvements that can be made,

Stepping back for a second there's a couple of documents that I've been
maintaining on building Mono under Windows with Cygwin (prior to being
introduced to Appveyor CI)

This covers 3.4.0 - 3.6.0,

And this covers 3.8.0+

It gets you to the point you can just about use Mono but there are some
remaining issues I have yet to address,


- understanding how the Mono installer works
- dealing with hard coded library references in the build (I think the
installer may do some of this)
- ensuring that Windows batch files for e.g. mcs, mono, xbuild are
correcly created (Again I think the installer may do some of this)


Further to that I then created a build script for the Appveyor build
platform, based on work and suggestions from Mladen Mihajlovic, which is
currently automatically building Mono on commits to the repo

You can see the build history here:

The output "artifact" from any of these builds is currently a set of
Mono binaries which you _should_ be able to download and use straight
away (would love some feedback on any issues here)

e.g. https://ci.appveyor.com/project/ajlennon/mono-817/build/artifacts

You should also be able to take the script I created and use this to
build your own build of Mono, independently of the instruction documents
I reference above. In particular there's a useful line there that
automates installation of needed Cygwin packages.

See here: https://github.com/mono/mono/blob/master/appveyor.yml
(build_script section)

What I'd like to do next is to modify this script to take the bones of
the Windows installer and generate an output artifact which was an MSI

Unfortunately this is not trivial (to me at least!), and also requires
pulling in some GTK# dependencies and so forth. I want to progress this
but have not yet had time due to work commitments.

Also, and perhaps more importantly the Cygwin build may all become
somewhat deprecated as Jo Shields appears to be doing some excellent
work to make Mono build under MSVC.

Once this is achievable, to my mind it will be a vastly superior way to
build Mono, instead of the 2 hour+ Cygwin build with all the faff.

>> Also, what is the best Linux distro to build mono?  OpenSUSE?  Debian,
>> Ubuntu?  It has been awhile for me.  Not starting a flame war here - just
>> wanting the easiest route to get the dependencies on linux  in order to build
>> the latest mono from git.
> On basically any system I've seen so far, building is easy.  The basic process of "./configure && make && make install" usually works.  If it doesn't, then add "make get-monolite-latest" before "make EXTERNAL_MCS=..."  as below...
> On every redhat-based or debian-based (or even mac) system I've ever used, one of these two variants has always worked.
> export BUILDDIR=/Users/whatever/Projects/mono-build
> export NUMPROC=3 ; time ( test -d $BUILDDIR && rm -rf $BUILDDIR ; mkdir -p $BUILDDIR ; ./autogen.sh --prefix=$BUILDDIR --disable-bcl-opt --enable-nls=no && make -j $NUMPROC && make install && echo "" && echo "    Done" && echo "")
> Ubuntu 14.04
> export BUILDDIR=/home/whatever/Projects/mono-build
> export NUMPROC=3 ; time ( test -d $BUILDDIR && rm -rf $BUILDDIR ; mkdir -p $BUILDDIR ; ./autogen.sh --prefix=$BUILDDIR --disable-bcl-opt --enable-nls=no && make get-monolite-latest && make -j $NUMPROC EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe" && make install && echo "" && echo "    Done" && echo "")

Possibly a bit off-topic but fwiw I maintain and use Yocto for Embedded
Linux with meta-mono layer. The recipes for building Mono are here,




More information about the Mono-devel-list mailing list