8

Can the .NET framework be installed on Linux, Unix, MAC etc. operating systems?

6
  • @Ravi, you might want to look at a very similar question here on SO, Is .NET platform independent? Feb 20, 2011 at 10:28
  • @xanatos: I don't know; I didn't change the tag. Feb 20, 2011 at 14:05
  • @xanatos: Seriously. I didn't change the tags. I have no idea why those tag changes ended up against my edit. Ah, yes I do. I did an earlier edit and found that someone else seemed to have reverted my changes, so I grabbed my earlier edit and reapplied it, not realising that I was also reverting their tag changes. You should think twice before accusing people of lying; there is often a perfectly innocent explanation. Feb 20, 2011 at 14:18
  • All lies are conscious, but not every falsehood is a lie. I was not offended, just offering you some advice. Feb 20, 2011 at 14:41
  • 1
    @xanatos: In English, a "lie" is always taken to be intentional, regardless of what Dictionary.com says. There are some usages that modulate this, such as, "Appearances often lie" (from TheFreeDictionary), but that is an anthropomorphism used to simplify and add color to an otherwise bland statement ("Appearances often give the wrong impression"). Under no circumstances would a statement such as, "John lied about being out of the country when his wife was murdered," be taken as a simple falsehood; the intent to deceive is always assumed. Feb 20, 2011 at 21:32

6 Answers 6

7

You should have a look at the Mono Project.

Mono is

An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET

1
  • Mono is nice, but even they don't claim to be fully compatible with .NET, e.g. from their own FAQ " it is very unlikely that the implementation will ever implement everything needed for full compatibility with Windows.Forms"
    – mikera
    Feb 20, 2011 at 12:36
5

.Net per-se, as most Microsoft sofware, is 100% plataform-dependent. It only works in Microsoft-provided enviroment (like Windows and its different flavors). Theres no official .Net for anything else (Mac, Linux, etc)

BUT...

Some plataforms do try to develop alternatives, emulators, etc, to try to run MS Software. Mono, as Nick posted, is a Linux project to support .Net code to run under Linux.

But Mono is NOT .Net. Its a different sofware, written by different people, that tries to be 100% compatible with .Net (and its actually damn awesome). But its not provided or supported by Microsoft.

And Mono, being an open-source, free sofware, is plataform-independent, as it can be ported to any plataform (currently, it already support several, not only Linux)

So, technically speaking, the correct answer would be:

.Net framework, as provided by Microsoft, is not plataform-indepedent at all. You can not install it in either Linux or Mac

But Mono, an independent, compatible .Net implementation, is supported and avaliable for install in both Linux and Mac, among several other plataforms. And you use it to run code written in .Net

6
  • 2
    "Microsoft" would be clearer than "Windows"; xbox isn't windows; zune is windows; WP7 isn't windows; MF doesn't target windows; CE (CF) is tickier to define... Feb 20, 2011 at 10:22
  • xbox is windows. Its actually a modified PC. But i got your point. Anyway, using "Microsoft" wouldnt be right either: MS is a vendor, not a plataform. So the best term would be "Microsoft-provided plataforms". Ill try to clarify that, thanks for pointing it out
    – MestreLion
    Feb 20, 2011 at 10:35
  • If xbox is Windows and Windows is OS/2 and all Unixes are BSD etc... I think we can safely refer to xbox as xbox. Of course they reuse some code, but there is very little in xbox that resembles Windows. (Notice how BSD socket security holes seems to affect almost all operating systems.) Feb 20, 2011 at 10:49
  • Humm, true. Upon further research, i must agree with you guys: given that code must be recompiled for xbox, its not byte-compatible, (doesnt even share the same APIs), i cant really say that "xbox is windows". Its just a "customized PC" rather than a completely new hardware plataform as, say, PS3. But thats waaaay off-topic :P
    – MestreLion
    Feb 20, 2011 at 10:59
  • (@MestreLion) I don't think there is a strong implication between Open Source and Platform Independance. A software could be so connected to a platform that porting to another would be as much difficult as rewriting it. It's probably true that, being open source AND being designed from the beginning as platform independant, it can be ported to other systems.
    – xanatos
    Feb 20, 2011 at 16:41
2

Linux has the Mono which is a .Net runtime for Linux. I do not know about other OS's.
Anyway, what makes it platform independent is the fact that it is being compiled to MSIL so any platform can implement the run-time and support it.

There is also an implementation for small embedded devices called .Net Micro Framework.

2
  • 1
    Mono is a open source .Net runtime not focusing on any OS. It works on many OS's and systems.
    – Dykam
    Feb 20, 2011 at 10:12
  • 1
    Mono is great - just be aware that it isn't ever likely to be fully compatible with Microsoft .NET. You can choose to target either Mono (in which case you will be cross-platform) or Microsoft.NET (in which case you are tied to Microsoft platforms). The reason for this is that there are platofrm-specific parts of Microsoft.NET that Mono is unlikely ever to implement.
    – mikera
    Feb 20, 2011 at 12:40
1

.Net can be looked at as two separate parts. One is the ECMA standardized CLI and the other is CLR. CLR is Microsofts implementation of CLI.

CLI can be executed on many devices, such as Windows (x86, x64, ia64 and now ARM), XBox, Zune, mobile phones and even embedded devices (small chips). Mono/Moonlight are implementations of CLI and even parts of CLR partially funded by Microsoft through Novell. Microsoft supports this work and releases source code to aid. Through Mono you can reach most operating systems and CPU types.

There are also compilers that can compile .Net code directly to platform independent code that can be directly executed by the CPU. Nice in case you want to write your own operating system in C#. (I don't remember names, but I can Google some links if interested.)

CLI is designed to be platform and langugage independent. It runs well on most operating systems and CPU's through various implementations. In practice does this mean that it supports for example language features such as case sensitive/case insensitive variables (+ muuuch more) and it has an instruction set compatible with most CPU's (the CLI machine code resembles the instructions most CPU's offer).

Implementations of .Net (overview to answer your question):

2
  • 2
    -1 for not answering the question / a very misleading answer. The standardised CLI is a tiny subset of .NET despite what Microsoft PR would like you to believe, and the rest of it is most certainly not platform independent (e.g. the Base Class Libraries contain Windows Forms - try implementing that anywhere else!). There is no complete and compatible implementation for anything other than a Microsoft platform (mono is a nice project for sure, but it's neither complete nor compatible)
    – mikera
    Feb 20, 2011 at 12:34
  • Perhaps I didn't explain it clearly. ".Net Framework" is CLR, not CLI. ".Net" is a general term used for CLI and CLR. ".NET Framework" is the platform (in)dependent Microsoft implementation of CLI topped with CLR. My intent was to give a full explanation of all the options and their relation, not just ".Net Framework". Thats how I read the question. :) Feb 20, 2011 at 19:17
1

The response to your very precise question is NO. The response to the question "can a .net program be run on these OS" is different. And it's MAYBE. As written by others, look for Mono.

Addendum (this is a later edit)

I now think my answer wasn't complete. I should have answered "Yes. You install wine and then install the .net framework". Here a link with an example (for ubuntu and .net 2.0): http://ubuntuforums.org/showthread.php?t=943298

Yes, I DO know this isn't the answer to what the OP probably WANTED to know, but it's at least a partial answer to what he ASKED.

1
  • While I was a little meta-ironic, my response was complete and true. So whoever gave me a -1 should at least justify it a little. I even gave a response to an ungiven question. Who am I to read the mind of the questioner? Persons should learn that if they want a good answer they must learn to give good questions. A good question has nearly as much value as a good answer.
    – xanatos
    Feb 20, 2011 at 12:02
0

You need to use the free and open sourced alternative .NET implementation called Mono

On wikipedia

Main site

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.