123

I'd like to know if there are effective and open source tools to develop C# applications on Linux (Ubuntu). In particular, I have to develop Windows Forms applications.

I know about the Mono project, but I've never used it. What are the best tools (IDE, compiler, etc.) to set up a .NET developing environment on Ubuntu?

Is software developed on Linux runnable on Windows? Are there different behaviors or incompatibilities?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
davioooh
  • 23,742
  • 39
  • 159
  • 250
  • Also feel free to check out this question http://stackoverflow.com/questions/151350/ides-for-c-sharp-development-on-linux – NlightNFotis Jun 26 '12 at 08:45
  • This might also be somehow useful http://stackoverflow.com/questions/716077/which-linux-distribution-is-best-for-developing-a-mono-application-in-a-virtual?rq=1 – NlightNFotis Jun 26 '12 at 08:46
  • This may also be of interest: http://www.mono-project.com/WinForms_Getting_Started_Guide – NlightNFotis Jun 26 '12 at 08:47

7 Answers7

79

MonoDevelop, the IDE associated with Mono Project should be enough for C# development on Linux. Now I don't know any good profilers and other tools for C# development on Linux. But then again mind you, that C# is a language more native to windows. You are better developing C# apps for windows than for linux.

EDIT: When you download MonoDevelop from the Ubuntu Software Center, it will contain pretty much everything you need to get started right away (Compiler, Runtime Environment, IDE). If you would like more information, see the following links:

knocte
  • 16,941
  • 11
  • 79
  • 125
NlightNFotis
  • 9,559
  • 5
  • 43
  • 66
  • 1
    Is it software developed on linux runnable on windows? – davioooh Jun 26 '12 at 08:28
  • 3
    Software developed on windows or linux is runnable on top of .Net framework. So as long as it is possible to install .Net framework in OS it can run the application. You got to aware of the version though ;) – Shiham Jun 26 '12 at 08:32
  • @nvrtheless I was wonderng if different framework implementation can create incompatibilites – davioooh Jun 26 '12 at 08:34
  • 4
    Backward compatibility is always there as far as I know. Problems may occur if you try to run an application on top of .Net 2.0 which is developed with .Net 3.5 or any later versions. – Shiham Jun 26 '12 at 08:39
  • Though you should note, that .Net is always capable of more on Windows. Mono is more of a compatibility project, than an actual software development kit implementation. That's how I see it at least. – NlightNFotis Jun 26 '12 at 08:43
28

Now Microsoft is migrating to open-source - see CoreFX (GitHub).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Henry H.
  • 901
  • 8
  • 11
20

This is an old question but it has a high view count, so I think some new information should be added: In the mean time a lot has changed, and you can now also use Microsoft's own .NET Core on linux. It's also available in ARM builds, 32 and 64 bit.

Oh My Goodness
  • 216
  • 2
  • 9
JHBonarius
  • 10,824
  • 3
  • 22
  • 41
7

Mono Develop is what you want, if you have used visual studio you should find it simple enough to get started.

If I recall correctly you should be able to install with sudo apt-get install monodevelop

Chris Diver
  • 19,362
  • 4
  • 47
  • 58
  • The installation command is correct however you need to make sure that you have added the monodevelop repository to your system before you do this. Here is a currently working link: https://www.monodevelop.com/download/ And here is the way to add the repository: ``` sudo apt install apt-transport-https dirmngr sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list sudo apt update ``` – Jason R Feb 27 '20 at 05:36
7

I would suggest using MonoDevelop.

It is pretty much explicitly designed for use with Mono, and all set up to develop in C#.

The simplest way to install it on Ubuntu would be to install the monodevelop package in Ubuntu. (link on Mono on ubuntu.com) (However, if you want to install a more recent version, I am not sure which PPA would be appropriate)

However, I would not recommend developing with the WinForms toolkit - I do not expect it to have the same behavior in Windows and Mono (the implementations are pretty different). For an overview of the UI toolkits that work with Mono, you can go to the information page on Mono-project.

Jean Hominal
  • 16,518
  • 5
  • 56
  • 90
5

Mono is a runtime environment that can run .NET applications and that works on both Windows and Linux. It includes a C# compiler.

As an IDE, you could use MonoDevelop, and I suppose there's something available for Eclipse, too.

Note that WinForms support on Mono is there, but somewhat lacking. Generally, Mono developers seem to prefer different GUI toolkits such as Gtk#.

O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
0

You can also install it using conda (tested on Ubuntu):

conda create --name csharp
conda activate csharp
conda install -c conda-forge mono
piertoni
  • 1,933
  • 1
  • 18
  • 30