<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>centriment &#187; mono</title>
	<atom:link href="http://www.centriment.com/tag/mono/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.centriment.com</link>
	<description>stories of the spirit living inside the computer</description>
	<lastBuildDate>Sun, 26 Jul 2009 12:29:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Patch for Monodevelop 2.0 debugger for Mono 2.4.2.2</title>
		<link>http://www.centriment.com/2009/07/26/patch-for-monodevelop-2-0-debugger-for-mono-2-4-2-2/</link>
		<comments>http://www.centriment.com/2009/07/26/patch-for-monodevelop-2-0-debugger-for-mono-2-4-2-2/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 12:28:16 +0000</pubDate>
		<dc:creator>Jan Dzik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono/.NET]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[monodevelop]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.centriment.com/?p=268</guid>
		<description><![CDATA[A while ago I posted a how-to on compiling Mono 2.4 from source on Ubuntu. After the release of a minor version update for mono, Mono 2.4.2.2 it was impossible to compile debugger support for Monodevelop 2.0 using Mono 2.4.2.2 sources.
The reason is because in mono 2.4.2.2 the mono-debugger was also updated, to version 2.4.2.1, [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I posted a <a title="How to compile Mono 2.4 from source on Ubuntu" href="http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/">how-to</a> on compiling Mono 2.4 from source on Ubuntu. After the release of a minor version update for mono, Mono 2.4.2.2 it was impossible to compile debugger support for Monodevelop 2.0 using Mono 2.4.2.2 sources.</p>
<p>The reason is because in mono 2.4.2.2 the mono-debugger was also updated, to version 2.4.2.1, breaking compatibility with monodevelop-debugger-mdb-2.0. I found <a href="http://www.centriment.com/2009/07/26/monodevelop-2-0-debugger-with-mono-2-4-2-2/" target="_blank">a way to solve this</a> and provide a patch.</p>
<p><strong>Download the patch from</strong> <a title="Patch file for monodevelop-debugger-mdb-2.0" href="http://www.centriment.com/downloads/patches/monodevelop-debugger-mdb-2.0.mono-debugger-2.4.2.1.patch">here</a>.</p>
<h3>Applying the patch</h3>
<p>Copy the patch from where you downloaded it, to the directory containing the source directory for monodevelop-debugger-mdb-2.0, e.g (~/src/mono-2.4.2.2).</p>
<p>And patch the sources like this:</p>
<pre>patch -p0 &lt; monodevelop-debugger-mdb-2.0.mono-debugger-2.4.2.1.patch</pre>
<p>The resulting output  output should be something similar to this:</p>
<pre>anirothan@lapitop:~/src/mdb-patch/original$ patch -p0 &lt; monodevelop-debugger-mdb-2.0.mono-debugger-2.4.2.1.patch
patching file monodevelop-debugger-mdb-2.0/Mono.Debugging.Server.Mdb/RuntimeInvokeManager.cs
anirothan@lapitop:~/src/mdb-patch/original$</pre>
<p>Now you can confiure &amp; make &amp; make install the sources as usual.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.centriment.com/2009/07/26/patch-for-monodevelop-2-0-debugger-for-mono-2-4-2-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monodevelop 2.0 debugger with Mono 2.4.2.2</title>
		<link>http://www.centriment.com/2009/07/26/monodevelop-2-0-debugger-with-mono-2-4-2-2/</link>
		<comments>http://www.centriment.com/2009/07/26/monodevelop-2-0-debugger-with-mono-2-4-2-2/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 12:17:32 +0000</pubDate>
		<dc:creator>Jan Dzik</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono/.NET]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[monodevelop]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.centriment.com/?p=260</guid>
		<description><![CDATA[A while ago I posted a how-to on compiling Mono 2.4 from source on Ubuntu. Well, the mono project released an update: mono 2.4.2.2 about a month ago. So, obviously people wanted to update their systems and tried to compile the new source packages. But there seems to be a problem. The debugger plugin for [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I posted a how-to on compiling Mono 2.4 from source on Ubuntu. Well, the mono project released an update: mono 2.4.2.2 about a month ago. So, obviously people wanted to update their systems and tried to compile the new source packages. But there seems to be a problem. The debugger plugin for monodevelop 2.0 (monodevelop-debugger-mdb-2.0) failed to compile.</p>
<p>Responding to a series of comments on my blog mentioning this annoying problem I looked into the situation and I have produced a patch for monodevelop-debugger-mbd-2.0 sources. You can download the patch from <a title="Patch file for monodevelop-debugger-mdb-2.0" href="http://www.centriment.com/downloads/patches/monodevelop-debugger-mdb-2.0.mono-debugger-2.4.2.1.patch">here</a>, and the instructions on applying it in this <a title="How to apply the monodevelop-debugger-mdb-2.0 patch" href="http://www.centriment.com/2009/07/26/patch-for-monodevelop-2-0-debugger-for-mono-2-4-2-2">post</a>.</p>
<p>As it turns out, in mono 2.4.2.2 there is a new version of the mono debugger, version 2.4.2.1. And with this new version came some breaking changes. Monodevelop uses the mono debugger through a plugin (contained in this source package: <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-debugger-mdb/monodevelop-debugger-mdb-2.0.tar.bz2">monodevelop-debugger-mdb-2.0.tar.bz2</a>). The sources of the plugin were not updated for the new version of mono debugger so any attempt to compile them failed.</p>
<p>Following is an excerpt from the compilation indicating the problem:</p>
<pre>./RuntimeInvokeManager.cs(49,50): warning CS0612: `Mono.Debugger.Thread.RuntimeInvoke(Mono.Debugger.Languages.TargetFunctionType, Mono.Debugger.Languages.TargetStructObject, Mono.Debugger.Languages.TargetObject[], bool, bool)' is obsolete
./RuntimeInvokeManager.cs(57,68): error CS1501: No overload for method `AbortInvocation' takes `0' arguments
./RuntimeInvokeManager.cs(78,60): error CS1501: No overload for method `AbortInvocation' takes `0' arguments
Compilation failed: 2 error(s), 2 warnings
make[1]: *** [../build/DebuggerServer.exe] Error 1
make[1]: Leaving directory `/home/anirothan/src/mono-2.4.2.2/monodevelop-debugger-mdb-2.0/Mono.Debugging.Server.Mdb'
make: *** [all-recursive] Error 1</pre>
<p>The problem is with the <em>monodevelop-debugger-mdb-2.0/Mono.Debugging.Server.Mdb/RuntimeInvokeManager.cs</em> file. On line 49 the RuntimeInvoke() mehtod is deprecated in the new version of mono debugger as indicated by the warning message, and the two invocations to AbortInvocation() on lines 57 and 78 have incompatible signatures with the method&#8217;s definition.</p>
<p>Invocation of AbortInvocation in <em>monodevelop-debugger-mdb-2.0/Mono.Debugging.Server.Mdb/RuntimeInvokeManager.cs </em>lines 55-58 and 76-79:</p>
<pre>res.Abort ();
res.CompletedEvent.WaitOne ();
ctx.Thread.AbortInvocation ();
WaitToStop (ctx.Thread);</pre>
<p>The AbortInovacation() method is defined in the mono debugger package, in <em>mono-debugger-2.4.2.1/classes/Thread.cs</em>.  If you compare this method between mono-debugger-2.4 and mono-debugger-2.4.2.1 you will see that in 2.4 it is public whereas in 2.4.2.1 it is made internal. Therefore, we couldn&#8217;t just figure out what the parameter to AbortInvocation() should be since there would be now way of invoking it.</p>
<p>AbortInvocation() in mono-debugger-2.4</p>
<pre>public void AbortInvocation ()
{
  CommandResult result;

  lock (this) {
    check_alive ();
    result = servant.AbortInvocation ();
  }

  result.Wait ();
}</pre>
<p>AbortInvocation() in mono-debugger-2.4.2.1</p>
<pre>internal void AbortInvocation (long rti_id)
{
  lock (this) {
    check_alive ();
    servant.AbortInvocation (rti_id);
  }
}</pre>
<p>However, all is not lost. It seems that in <em>RuntimeInvokeManager.cs </em>there is an obvious code duplication in lines 55-58 and 76-79 where AbortInvocation() is called. It seems that these lines have been moved from the monodevelop debugger plugin to the mono debugger itself. Indeed, below is how Abort() is defined in the <em>RuntimeInvokeResult</em> class in <em>mono-debugger-2.4.2.1/classes/Thread.cs </em>and <em>mono-debugger-2.4/classes/Thread.cs:</em></p>
<p>in 2.4:</p>
<pre>public override void Abort ()
{
  thread.Stop ();
}</pre>
<p>and in 2.4.2.1</p>
<pre>public override void Abort ()
{
  Thread.AbortInvocation (ID);
  completed_event.WaitOne ();
}</pre>
<p>There it goes! The offending call to AbortInvocation(), which caused the compilation to fail, has been moved to Abort(), which is already being called on lines 55 and 76.</p>
<p>So, all we need to do is delete lines 56, 57 and 77,78 from <em>RuntimeInvokeManager.cs.</em> If we try to compile monodevelop-debugger-mdb-2.0 after this simple change we will see no more error messages and the debugger will work in monodevelop 2.0.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 81px; width: 1px; height: 1px;">
<pre>RuntimeInvokeManager.cs</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.centriment.com/2009/07/26/monodevelop-2-0-debugger-with-mono-2-4-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Interactive C# (REPL)</title>
		<link>http://www.centriment.com/2009/06/18/using-interactive-c-repl/</link>
		<comments>http://www.centriment.com/2009/06/18/using-interactive-c-repl/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 08:42:50 +0000</pubDate>
		<dc:creator>Jan Dzik</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono/.NET]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[gsharp]]></category>
		<category><![CDATA[gtk#]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[repl]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.centriment.com/?p=226</guid>
		<description><![CDATA[The REPL, that is Read Eval Print Loop, is a feature provided by many programming language environments today, such as Python, Ruby, Scala and Haskel. For those who are not familiar with the notion, you could think of REPL as an interactive interpreter (even though it&#8217;s not always implemented as one). You can find more [...]]]></description>
			<content:encoded><![CDATA[<p>The REPL, that is Read Eval Print Loop, is a feature provided by many programming language environments today, such as Python, Ruby, Scala and Haskel. For those who are not familiar with the notion, you could think of REPL as an interactive interpreter (even though it&#8217;s not always implemented as one). You can find more info <a title="REPL by WikiPedia" href="http://en.wikipedia.org/wiki/REPL" target="_blank">here</a>.</p>
<p>It practically is an interactive prompt (like a UNIX shell, or Windows PowerShell), that accepts expressions in your favorite programming language syntax. There was no practical implementation of a REPL for C# until the Mono project <a title="Mono Project C# REPL implementation" href="http://www.mono-project.com/CsharpRepl" target="_blank">implemented</a> a C# Interactive Shell in Mono 2.2, called <em>csharp</em>. It comes with two flavors: 1). as a command line shell under the name <em>csharp</em> and 2). with a graphical front end called <em>GSharp.</em></p>
<p>I am sure that every developer, novice or seasoned, needs to test out some small snippet of code, from time to time, to make sure that it does what it is supposed to do. This is also true for C# developers. However, in the absence of a REPL for C#, the only way to do that was by creating a whole new project in Visual Studio or MonoDevelop with a very simple console application. Not only it seems like an overkill if you just want to test a few lines of code, but you also end up with a bunch of little test projects that you are never going to need.</p>
<p>However, now that Mono implemented a C# REPL there is no need to create a test console project for everything. It is extremely useful if you want to test out some piece of code.</p>
<p>An example from my own experience is when, in a C# project I have been working on, I needed to dynamically create a list of enum field values and their string names. I was not 100% percent sure of the way I thought of implementing this, so I wanted to test it out first.</p>
<p>Here it is, in the <em>csharp</em> interactive C# shell, running from a Linux command line:</p>
<pre>anirothan@netbook:~$ mono-2.4 csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp&gt; var fileModeNames = Enum.GetNames(typeof(System.IO.FileMode));
csharp&gt; fileModeNames;
{ "CreateNew", "Create", "Open", "OpenOrCreate", "Truncate", "Append" }
csharp&gt; var fileModeValues = Enum.GetValues(typeof(System.IO.FileMode));
csharp&gt; fileModeValues;
{ CreateNew, Create, Open, OpenOrCreate, Truncate, Append }
csharp&gt; var pairs = new Dictionary&lt;string, System.IO.FileMode&gt;();
csharp&gt; for(int i=0; i&lt;fileModeValues.Length; ++i)
 &gt; pairs.Add(fileModeNames[i], fileModeValues.GetValue(i));
{interactive}(2,7): error CS1502: The best overloaded method match for `System.Collections.Generic.Dictionary&lt;string,System.IO.FileMode&gt;.Add(string, System.IO.FileMode)' has some invalid arguments
/opt/mono-2.4/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
{interactive}(2,7): error CS1503: Argument `#2' cannot convert `object' expression to type `System.IO.FileMode'
csharp&gt; var pairsCorrect = new Dictionary&lt;string, object&gt;();     
csharp&gt; for(int i=0; i&lt;fileModeValues.Length; ++i)               
 &gt; pairsCorrect.Add(fileModeNames[i], fileModeValues.GetValue(i));
csharp&gt; pairsCorrect;
{{ "CreateNew", CreateNew }, { "Create", Create }, { "Open", Open }, { "OpenOrCreate", OpenOrCreate }, { "Truncate", Truncate }, { "Append", Append }}
csharp&gt; pairsCorrect["CreateNew"]
 &gt; ;
CreateNew
csharp&gt; quit;
null</pre>
<p>That was fairly easy and simple. The intention was to create a dictionary of enum field names and values. For the sake of testing I used the<em> System.IO.FileMode</em> enum.</p>
<p>The flexibility of the csharp REPL does not end there. Here is an extract from a session in gsharp (The gtk+ graphical front-end to csharp) which actually creates a window with a dropdown list.</p>
<pre>csharp&gt; LoadPackage("gtk-sharp-2.0");
csharp&gt; using Gtk;
csharp&gt; var window = new Window("Simple dropdown list binding test with csharp REPL");
csharp&gt; var vbox = new VBox();
csharp&gt; var label = new Label("This is a simple test.");
csharp&gt; vbox.PackStart(label);
csharp&gt; var model = new ListStore(typeof(System.IO.FileMode), typeof(string));
csharp&gt; var fileModeNames = Enum.GetNames(typeof(System.IO.FileMode));
csharp&gt; fileModeNames;
{ "CreateNew", "Create", "Open", "OpenOrCreate", "Truncate", "Append" }
csharp&gt; var fileModeValues = Enum.GetValues(typeof(System.IO.FileMode));
csharp&gt; fileModeValues;
{ CreateNew, Create, Open, OpenOrCreate, Truncate, Append }
csharp&gt; var model = new ListStore(typeof(System.IO.FileMode), typeof(string));
csharp&gt; for(int i=0; i&lt;fileModeValues.Length; ++i)
 &gt; model.AppendValues(fileModeValues.GetValue(i), fileModeValues[i]);
{interactive}(2,48): error CS0021: Cannot apply indexing with [] to an expression of type `System.Array'
csharp&gt; for(int i=0; i&lt;fileModeValues.Length; ++i)
model.AppendValues(fileModeValues.GetValue(i), fileModeNames[i]);
csharp&gt; var dropDown = new ComboBox();
csharp&gt; var renderer = new CellRendererText();
csharp&gt; dropDown.PackStart(renderer, true);
csharp&gt; dropDown.AddAttribute(renderer, "text", 1);
csharp&gt; dropDown.Model = model;
{ { CreateNew, "CreateNew" }, { Create, "Create" }, { Open, "Open" }, { OpenOrCreate, "OpenOrCreate" }, { Truncate, "Truncate" }, { Append, "Append" } }
csharp&gt; vbox.PackEnd(dropDown);
csharp&gt; window.Add(vbox);
csharp&gt; window.ShowAll();
csharp&gt;</pre>
<div id="attachment_249" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.centriment.com/wp-content/uploads/2009/06/REPL-GTK.png"><img class="size-medium wp-image-249" title="REPL-GTK#" src="http://www.centriment.com/wp-content/uploads/2009/06/REPL-GTK-300x175.png" alt="The GSharp C# Interactive Shell in action." width="300" height="175" /></a><p class="wp-caption-text">The GSharp C# Interactive Shell in action.</p></div>
<p>There are some limitations though. For example, you cannot create classes (but you can put .cs files in the <em>~/.config/csharp</em> directory that will be loaded automatically to the interactive shell) and there is an apparent lack of code completion features. However, these limitations are already being worked on and I hope they will become available with mono 2.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.centriment.com/2009/06/18/using-interactive-c-repl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Mono 2.4 from source on Ubuntu 8.10</title>
		<link>http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/</link>
		<comments>http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 10:14:11 +0000</pubDate>
		<dc:creator>Jan Dzik</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono/.NET]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c-sharp]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[monodevelop]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[repl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.centriment.com/?p=72</guid>
		<description><![CDATA[Sad to say that the latest versions of Ubuntu and Debian do not provide the latest packages of Mono preferring stability over bleeding edge. Also, according to the packagers&#8217;  mailing list it is not an easy task to provide packages for mono and all the software that binds to it.
I am a sucker for bleeding [...]]]></description>
			<content:encoded><![CDATA[<p>Sad to say that the latest versions of Ubuntu and Debian do not provide the latest packages of Mono preferring stability over bleeding edge. Also, according to the packagers&#8217;  mailing list it is not an easy task to provide packages for mono and all the software that binds to it.</p>
<p>I am a sucker for bleeding edge, especially when it comes to thinks like Mono. The latest stable release of Mono, version 2.4 has a lot of new features like the C# interactive repl shell, SIMD extensions and better support for C# 3/.NET 3.5 features, like extension methods and LINQ. See the release notes <a title="Mono 2.4 Release notes" href="http://www.mono-project.com/Release_Notes_Mono_2.4" target="_blank">here</a>. I was disappointed when the most recent version of mono debian packages I could find were for the 2.0.1 version on third-party repositories.</p>
<p>What to do then? Download the source, configure and build to run in parallel to the version of mono installed in my Ubuntu desktop (the mono run-time is always installed on Ubuntu by default, even the live CD runs it, since it is needed to run .NET applications, like F-Spot, that have become a standard in the GNOME desktop). It turns out that it&#8217;s not that difficult as it sounds.</p>
<h2>Step 1: Install prerequisites for compilation.</h2>
<p><span style="font-weight: normal;">First of all, you will need to setup the appropriate tools for configuring and compiling source code. You can install these through the Synaptic package manager but for the sake of speed let&#8217;s use some command line magik <img src='http://www.centriment.com/wp-content/plugins/tango-smileys-extended/tango/wink.png' alt='Wink' class='tse-smiley' /></span></p>
<p><span style="font-weight: normal;">Open a console and type in the following to install the gcc compiler, and development header files needed to compile the mono compilers, tools and library stack.</span></p>
<pre>user@system$&gt; sudo apt-get update
user@system$&gt; sudo apt-get install build-essential autoconf automake \
bison flex gtk-sharp2-gapi boo gdb valac libfontconfig1-dev \
libcairo2-dev libpango1.0-dev libfreetype6-dev libexif-dev \
libjpeg62-dev libtiff4-dev libgif-dev zlib1g-dev libatk1.0-dev \
libglib2.0-dev libgtk2.0-dev libglade2-dev libart-2.0-dev \
libgnomevfs2-dev libgnome-desktop-dev libgnome2-dev libgnomecanvas2-dev \
libgnomeui-dev libgnomeprint2.2-dev libgnomeprintui2.2-dev \
libpanel-applet2-dev libnautilus-burn-dev librsvg2-dev \
libgtkhtml3.14-dev libgtksourceview2.0-dev libgtksourceview-dev \
libvte-dev libwnck-dev libnspr4-dev libnss3-dev libxul-dev \
libwebkit-dev libvala-dev</pre>
<p>This should install all the necessary software and development headers needed for the compilation.</p>
<h2>Step 2: Download mono 2.4 source archives.</h2>
<p>Go to <a href="http://ftp.novell.com/pub/mono/sources-stable/">http://ftp.novell.com/pub/mono/sources-stable/</a> . You don&#8217;t need every archive in that list.<br />
In this guide we will use: <a href="http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.tar.bz2">mono-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.tar.bz2">libgdiplus-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/gluezilla/gluezilla-2.4.tar.bz2">gluezilla-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.tar.bz2">xsp-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/mono-tools/mono-tools-2.4.tar.bz2">mono-tools-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/gecko-sharp2/gecko-sharp-2.0-0.13.tar.bz2">gecko-sharp-2.0-0.13.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/mono-debugger/mono-debugger-2.4.tar.bz2">mono-debugger-2.4.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/mono-addins/mono-addins-0.4.zip">mono-addins-0.4.zip</a>, <a href="http://ftp.novell.com/pub/mono/sources/gtk-sharp212/gtk-sharp-2.12.8.tar.bz2">gtk-sharp-2.12.8.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/gnome-sharp220/gnome-sharp-2.20.1.tar.bz2">gnome-sharp-2.20.1.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/gnome-desktop-sharp2/gnome-desktop-sharp-2.20.1.tar.bz2">gnome-desktop-sharp-2.20.1.tar.bz2</a>, <a href="http://ftp.novell.com/pub/mono/sources/webkit-sharp/webkit-sharp-0.2.tar.bz2">webkit-sharp-0.2.tar.bz2</a></p>
<p>Also go to the MonoDevelop <a href="http://monodevelop.com/Download" target="_blank">website</a> and download the sources for monodevelop 2.0: <a href="http://ftp.novell.com/pub/mono/sources/monodevelop/monodevelop-2.0.tar.bz2">monodevelop-2.0</a>, <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-debugger-mdb/monodevelop-debugger-mdb-2.0.tar.bz2">monodevelop-debugger-mdb-2.0</a>, <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-debugger-gdb/monodevelop-debugger-gdb-2.0.tar.bz2">monodevelop-debugger-gdb-2.0</a>, <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-database/monodevelop-database-2.0.tar.bz2">monodevelop-database-2.0</a>, <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-java/monodevelop-java-2.0.tar.bz2">monodevelop-java-2.0</a>, <a href="http://ftp.novell.com/pub/mono/sources/monodevelop-vala/monodevelop-vala-2.0.tar.bz2">monodevelop-vala-2.0</a></p>
<p>Create a directory in your home directory for the extracted sources, e.g. <em>src/mono-2.4</em>.</p>
<pre>user@system$&gt; mkdir -p src/mono-2.4; cd src/mono-2.4</pre>
<p>Extract the downloaded archives to that directory.</p>
<h2>Step 3: Prepare the parallel environment</h2>
<p>Now it&#8217;s time to prepare our system for two versions of the mono runtime. A good idea is to install everything related to mono 2.2 to some path like /opt/mono-2.2 and create shell script to load an environment that will use the version located in that path instead of the default installation. That way you will not render your existing mono installation unstable or broken.</p>
<p>Now create a script that will load the separate mono-2.4 environment.</p>
<pre>user@system$&gt; cat &gt; mono-2.4-environment
#!/bin/bash
MONO_PREFIX=/opt/mono-2.4
GNOME_PREFIX=/opt/gnome-2.4
export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
PATH=$MONO_PREFIX/bin:$PATH
PS1="[mono-2.4] \w @ "</pre>
<p>[Press Ctrl+D for EOF to write the file and get back to the prompt]</p>
<pre>user@system$&gt; sudo mv mono-2.4-environment /usr/local/bin
user@system$&gt; sudo chmod +x /usr/local/bin/mono-2.4-environment</pre>
<p>And create a second script that will load the environment and execute its argurments.</p>
<pre>user@system$&gt; cat &gt; mono-2.4
#!/bin/bash
MONO_PREFIX=/opt/mono-2.4
GNOME_PREFIX=/opt/gnome-2.4
export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
PATH=$MONO_PREFIX/bin:$PATH

exec "$@"</pre>
<p>[Press Ctrl+D for EOF to write the file and get back to the prompt]</p>
<pre>user@system$&gt; sudo mv mono-2.4 /usr/local/bin
user@system$&gt; sudo chmod +x /usr/local/bin/mono-2.4</pre>
<p>Load the environment:</p>
<pre>user@system$&gt; source mono-2.4-environment</pre>
<p>After this command, the prompt should change and contain <em>[mono-2.4] </em>to indicate that you are operating in a Mono 2.4 environment.</p>
<pre>[mono-2.4] ~ @ cd ~/src/mono-2.4</pre>
<p><strong>NOTE!</strong> For the sake of readability the prompt indication in the instructions will remain the generic <em>user@system$&gt;</em> but for the rest of the guide you must make sure that you follow each step while in the 2.4 environment.</p>
<p>And now create the directory where everything will be installed:</p>
<pre>user@system$&gt; sudo mkdir -p /opt/mono-2.4</pre>
<h2>Step 4: libgdiplus</h2>
<p>Before compiling the main sources of mono we must compile libgdiplus if we want to have an implementation of the System.Drawing namespace.</p>
<pre>user@system$&gt; cd libgdiplus-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4 --with-pango</pre>
<p>The output of the configure script should be something like this:</p>
<pre>---
Configuration summary

   * Installation prefix = /opt/mono-2.4
   * Cairo = 1.8.0 (system)
   * Text = pango
   * EXIF tags = yes
   * Codecs supported:

      - TIFF: yes
      - JPEG: yes
      - GIF: yes
      - PNG: yes
      NOTE: if any of the above say 'no' you may install the
            corresponding development packages for them, rerun
            autogen.sh to include them in the build.

---</pre>
<p>If any of the options say no then you have a missing dependency. You might want to use the Synaptic package manager to find the appropriate package to install. However, these dependencies are optional.</p>
<p>Now it&#8217;s time to build the source.</p>
<pre>user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 5: mono-2.4</h2>
<p>Now it&#8217;s time to compile mono&#8217;s main sources which will produce, among others, the c# compilers and the base class libraries.</p>
<pre>user@system$&gt; cd ../mono-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<p>Verify that the mono compilers have been installed:</p>
<pre>user@system$&gt; which gmcs</pre>
<p>This should output: <em>/opt/mono-2.4/bin/gmcs<br />
</em>Your existing mono installation will be preserved since everything is installed to the /opt/mono-2.4 directory.</p>
<h2>Step 6: gtk+ and gnome</h2>
<p>Now it&#8217;s turn to compile libraries needed for desktop environment, namely gtk-sharp, gnome-sharp, gnome-desktop-sharp, gtksourceview-sharp.</p>
<pre>user@system$&gt; cd ../gtk-sharp-2.12.8
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../gnome-sharp-2.20.1
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../gnome-desktop-sharp-2.20.1
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 7: gluezilla, gecko-sharp, webkit-sharp</h2>
<p>Now lets compile libraries for embedding the gecko and webkit html rendering engines.</p>
<pre>user@system$&gt; cd ../gluezilla-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../gecko-sharp-2.0-0.13
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../webkit-sharp-0.2
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 8: build Mono.Addins</h2>
<p>Turn to compile the Mono.Addins libraries:</p>
<pre>user@system$&gt; cd ../mono-addins-0.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 9: build Mono tools</h2>
<p>Now it&#8217;s turn to compile the marvelous collection of Mono tools, including Gendarme and GSharp (the C# interactive shell).</p>
<pre>user@system$&gt; cd ../mono-tools-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<p>After this you have installed the gsharp tool. Test it out:</p>
<pre>user@system$&gt; gsharp</pre>
<p>Play a little with the C# repl <img src='http://www.centriment.com/wp-content/plugins/tango-smileys-extended/tango/smile.png' alt='Smile' class='tse-smiley' /> Type quit; when you&#8217;re done.</p>
<h2>Step 10: build Mono XSP</h2>
<p>This is actually something very useful. XSP is a standalone web server developed in C#. It can be run through the command line or even embedded into your application by referencing the Mono.WebServer assembly.</p>
<pre>user@system$&gt; cd ../xsp-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 11: build the Mono Debugger</h2>
<p>Getting closer to the end of our compilation session, let&#8217;s build the mono debugger allowing us to debug the faulty software we write.</p>
<pre>user@system$&gt; cd ../mono-debugger-2.4
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<h2>Step 12: build MonoDevelop 2.0</h2>
<p>Now what would all this be without a nice IDE? MonoDevelop 2.0 brings us finally debugger support!</p>
<pre>user@system$&gt; cd ../monodevelop-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../monodevelop-debugger-mdb-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../monodevelop-debugger-gdb-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../monodevelop-database-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../monodevelop-java-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install
user@system$&gt; cd ../monodevelop-vala-2.0
user@system$&gt; ./configure --prefix=/opt/mono-2.4
user@system$&gt; make
user@system$&gt; sudo make install</pre>
<p>And&#8230; That&#8217;s it. You now have a working mono-2.4 environment and an excellent IDE to work with.</p>
<p>You can launch any .NET program with Mono 2.4 with:</p>
<pre>user@system$&gt; mono-2.4 PATH_TO_THE_PROGRAM_AND_ITS_ARGUMENTS_IF_ANY</pre>
<p>For example to launch MonoDevelop 2.0:</p>
<pre>user@system#&gt; mono-2.4 monodevelop</pre>
<p><strong>NOTE!</strong> This will work only for shell scripts that are normally distributed with mono applications. If you look at<em> /opt/mono-2.4/bin/monodevelop</em> you will see that it is a shell script that essentially runs something like this: <em>mono /opt/mono-2.4/lib/monodevelop/bin/MonoDevelop.exe</em>. Trying to execute a .NET application, e.g. called main.exe, by typing <em>mono-2.4 main.exe</em> will fail. You sould type <em>mono-2.4 mono main.exe </em>instead.</p>
<p>Enjoy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
		</item>
	</channel>
</rss>
