Can the .NET framework be installed on Linux,开发者_开发技巧 Unix, MAC etc. operating systems?
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
.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
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.
.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):
- Microsoft .Net Framework: Windows
- Microsoft .Net Compact Framework: Windowsm Xbox, Zune, mobile devices
- Microsoft .Net Micro Framework: Embedded/very limited devices
- Mono: Unix, Linux, Windows, Mac
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.
You need to use the free and open sourced alternative .NET implementation called Mono
On wikipedia
Main site
精彩评论