1

I have written few simple console C# programs in Monodevelop but it seems they run in some emulated enviroment while debugging. The end result is a .exe file which does not runs natively on Ubuntu.

What I need to know is if Mono is same as Visual C# on Windows? Can we create native GUI applications with Monodevelop just as we can with QT Creator(Linux)/Visual Studio(Windows)? If yes, how? If no, why? Why we need Mono on Linux?

GunJack
  • 361
  • 2
  • 5
  • 19
  • These are not (specifically) Windows applications; C# is a .NET language, and is intended for the creation of cross-platform executables that run on a .NET Common Language Runtime implementation. On Ubuntu that implementation is (usually) Mono. This is, in a certan sense, an emulated environment, but (the vast majority of) C# programs always run this way, even in production. If you don't *explicitly* want this, you probably want to use a different language. It seems what you're asking about here is fully answered in [this question](http://askubuntu.com/q/31273) (we could maybe dupe this). – Eliah Kagan Jan 07 '14 at 22:58
  • 2
    @EliahKagan mm... that question has a different scope of this one. Maybe we need either explain completely how Mono works (I belive your comment do this). – Braiam Jan 09 '14 at 01:44
  • 1
    **GunJack**: Do you feel that what you're asking is not really answered by [the information there](http://askubuntu.com/q/31273)? If so, then maybe we shouldn't close this (or reopen it if it gets closed). Please let us know! You can do this by commenting or by editing your question. @Braiam Hmm... do we already have a question that explains Mono and how programs that will run on Mono (such as most C# programs, at least most of those developed with MonoDevelop) are different from native Linux executables? I'd be willing to expand my comment into a full answer here but maybe we already have it? – Eliah Kagan Jan 09 '14 at 05:21
  • 1
    I don't think if the other question is in line with what I seek to know. I have edited my question to make more understandable. Sorry for the bad English, I am not a native speaker. – GunJack Jan 09 '14 at 06:40

2 Answers2

1

C# and all the other languages belonging to the .NET framework are interpreted languages. They are pseudo-compiled, not truly compiled (like C). The bytecode of the .NET framework is called Common Intermediate Language (CIL).

The interpreter (sometimes known as "virtual machine") for the Common Intermediate Language is the .NET Common Language Runtime on Windows and Mono on Linux. Therefore, C# applications won't run "native" (i.e. without an interpreter), not even on Windows.

Probably what surprises you is that Mono is not installed by default on some Linux distributions, while the .NET runtime is.

Anyhow, you can write applications in C# that are nicely integrated with Ubuntu. An example is Tomboy.

There's also an another language, similar to C#, developed by the GNOME project, which is Vala. Vala is translated into C, which is itself compiled, so it will run "native". Because Vala was built by GNOME developers for GNOME developers, it is extremely easy to integrate with the GNOME desktop environment.

Andrea Corbellini
  • 15,616
  • 2
  • 64
  • 81
1

To develop for Ubuntu use the QML SDK:

Get the SDK | Ubuntu Developer

blade19899
  • 26,496
  • 21
  • 113
  • 177
Brask
  • 1,580
  • 10
  • 18