[Mono-dev] Editing mono in IDE?

Edward Ned Harvey (mono) edward.harvey.mono at clevertrove.com
Sun Jun 8 14:41:00 UTC 2014

=== Section 1: Building Mono ===

Don't expect the .sln file to work.   Just follow the standard build process.  The README is a good starting point, but I'll add the following, which started as the standard simple process from the README, but bits and pieces have been added over time, based on experience:

If you want to contribute to mono, don't clone mono sources.  Instead, fork, and then clone your fork.  Later, you can submit a pull request.

cd to the directory where you cloned the sources.

Note:  BuildDir must be absolute path.  Not allowed to use ~ symbol.  (I forget why.)
export BUILDDIR=/Users/whatever/mono-build

(How many processors do you have?  This speeds up "make -j $NUMPROC")
export NUMPROC=2

Note:  --disable-bcl-opt   is important and useful for debugging.
Note:  --enable-nls=no  might or might not be necessary on your system depending on your system installed packages

Normally, use this build command:   (But since you specifically said ubuntu 14.04, see below)
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 "")

(Takes approx 30 minutes)

On some systems (including ubuntu14.04) you may need the alternate build command:
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 "")

=== Section 2: Debugging Mono ===

Inside Xamarin Studio, create some dumb new project. By default only a single runtime registered so the Project / Active Runtime menu item doesn't appear. I had to go to Xamarin Studio / Preferences / .NET Runtimes / Add. Add the newly built runtime environment. The system thinks a while, and then the Project / Active Runtime menu becomes available, to select my newly compiled runtime.

Go to Xamarin Studio / Preferences / Debugger. And un-check the checkbox: 
[_] Debug project code only; do not step into framework code

And now for example, I'm able to write an app with: 
RSACryptoServiceProvider myrsa = new RSACryptoServiceProvider (3072); 
myrsa.ExportParameters (includePrivateParameters: false);

And I'm able to Start Debugging. And step into the RSA code to see what it's doing internally.  Hooray! :-)

More information about the Mono-devel-list mailing list