views:

5979

answers:

4

I start using Ubuntu 9.04 on my laptop. What I really want is to be able to write my C# projects on Ubuntu, including unit testing. Could anyone guide me how to setup it?

A: 

EDIT: Added mono-devel

I use Ubuntu 8.04, but what do you really need to setup? Doing (if you haven't already):

sudo apt-get install monodevelop nunit mono-devel

should give you what you need. And there are plenty of tutorials for both monodevelop (e.g. http://monodevelop.com/Documentation/Creating_A_Simple_Solution) and NUnit (e.g. http://www.nunit.org/index.php?p=quickStart&r=2.4.8)

Matthew Flaschen
To get Mono 2.4 and MonoDevelop 2.0 installed?
Samnang
Samnang, the above will install monodevelop 2.0. Mono 2.4 was /just/ released (see http://go-mono.com/forums/#nabble-td23669501) and is not in even Karmic yet. I would suggest sticking to the distro packages at first.
Matthew Flaschen
The version of mono in Ubuntu has known bugs. I would highly recommend to upgrade. Besides its a very old version.
Anders Rune Jensen
+4  A: 

In addition to the basic packages Matthew suggested, you'll also want the monodevelop-nunit package, which allows you to run and debug unit tests from within the IDE. For the debugger, you'll want monodevelop-debugger-mdb. You probably also want monodevelop-versioncontrol for SVN support, mono-xsp2 for running ASP.NET apps, and monodoc-browser for the docs viewer.

Maybe you're best off just installing all of the packages 'suggested' by the MonoDevelop package -- I believe the Ubuntu package manager has a way to do this easily from its GUI.

Beware that Ubuntu splits up Mono into many, many small packages, so if something's missing, use the apt-file tool or similar to find which package you need to install.

Ubuntu doesn't have Mono 2.4 packages yet; if you require 100% up-to-date packages, your best bet is to use openSUSE. The only way to get 2.4 on Ubuntu right now is to build from source -- and if you decide to do that, please read How not to break Mono installations first.

mhutch
There is no reason to compile from source. There is already debian packages available here (just add to apt sources list): deb debian.meebey.net/pkg-mono/mono /
Anders Rune Jensen
Why the downvote?
mhutch
@mhutch could you update your answer. Mono 2.4 is available in Lucid and 2.67 will be available in Maverick. Also, if you need the bleeding-edge version follow what Stefan's answer suggests.
Evan Plaice
@mhutch Almost forgot, here's the link to the planned release schedule for Ubuntu. http://mono-project.com/DistroPackages/Ubuntu.
Evan Plaice
+1  A: 

I would suggest using 2.4 as it has all the latest .net goodness.

There are two guides I would suggest using:

http://blog.ruski.co.za/page/Install-Mono-on-Ubuntu.aspx

http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/

The latter lets you keep the mono install that comes with ubuntu so you can still install apps from synaptic. I would suggest using this. Both guides however are really clear about what is required to install it. It looks menacing at first but if you take a couple of hours to follow it then you will see it is actually quite easy.

Good luck

Derek Ekins
There is no reason to compile from source. There is already debian packages available here (just add to apt sources list): deb http://debian.meebey.net/pkg-mono/mono /
Anders Rune Jensen
There are a couple of reasons actually..Not everyone uses a debian based distribution (yes in this case). Often these repositories mono repositories are setup with good intentions and then fail to be updated. (maybe because it is so easy to compile from source?) so you end up in a position where you have to change repositories in order to get the latest bits
Derek Ekins
Yeah well he was on Ubuntu :)
Anders Rune Jensen
+2  A: 

You probably already updated to 10.04 in the meanwhile. For 10.04 (and 8.04) you can use the badgerports. I didn't try it (yet), but it looks reliable.

Stefan Steinegger