0

I want to know how I can use c# in Ubuntu 10.04?

I just want to run some program written in c# and compile them on Ubuntu. Can any body tell me how to do this ?

On my Windows system it's quite easy: I just install visual studio, I write the program in notepad and run it at the command prompt.

Can anybody tell me what should I do to get c# working on my Ubuntu system?

How to install c# in ubuntu?

How to run c# program in ubuntu?

2
  • 5
    You have Visual Studio installed and you use notepad to write code? Commented May 4, 2011 at 10:38
  • 2
    @Greg: the relevant part in that sentence is the command-line, a good prep for moving to Mono. Commented May 4, 2011 at 10:41

6 Answers 6

5
$ sudo apt-get install mono monodevelop monodoc

You need not use monodevelop (although it is actually very good). After installing the above you can edit .cs source files in whatever editor you like ( gedit, vim, emacs ) and then compile sources by hand using the mono compiler ( gmcs is the mono equivalent of csc ).

I'd suggest you take a good look at monodevelop though as you have to manage things like your library dependencies. Hand writing Makefiles or autoconf isn't fun and isn't portable. Monodevelop lets you define normal .sln and .csproj files and optionally generate Makefiles.

Sign up to request clarification or add additional context in comments.

Comments

1

you have to use mono for that

http://www.mono-project.com/DistroPackages/Ubuntu

Comments

1

You dont install C#... you install .NET CLR and C# compilers ... anyway

MONO is a .NET implementation that can run on many OSs including Ubuntu

To run .NET apps just install MONO http://www.mono-project.com/

Or MonoDevelop if you need a .Net Development environment on linux http://monodevelop.com/

Comments

1

With mono installed (see other answers)

(substitute favorite $EDITOR)

$EDITOR mytest.cs

# edit, save
gmcs mytest.cs

mono ./mytest.exe

Most distributions will allow you to jyst say ./mytest.exe instead of mono ./mytest.exe

This assumes .NET 3.5 targeting

Comments

0

You have to install Mono for ubuntu to be compatible with .Net framework.
You could start here : click

Comments

0

First you need to download & install MonoDev. http://monodevelop.com/

It sounds like your making console app, so just run the program in the terminal.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.