views:

296

answers:

10

.NET is a language independent platform.

But is it platform independent as well ? How ?

EDIT : I have heard, .NET 4.0 is developed considering plateform independency ! Well, hope it may take over Java, if so !

EDIT : The answer depends upon the way how we define 'platform', like .NET for windows platform and Mono for Java.

But, the question is, don't do we have general development platform which is OS independent !

Does OS independency related to platform independency ?

A: 

Mono is a cross platform implementation of .NET, but it is not supported by Microsoft and is missing some functionality.

Sjoerd
Silverlight is a cross-platform subset of .NET that is supported by Microsoft.
Joel Mueller
_@Sjoerd_, strictly speaking (sorry for being pedantic, but I feel it's worth pointing out), Mono is an _implementation_ of the _CLI_. It's an _alternative_ to _.NET_ (which itself implements the CLI).
stakx
+3  A: 

Not sure what do you mean by your question, but if you want to know if a .NET application can run on any OS, that the answer is no.

.NET Framework targets only some operating systems, like Windows. Other projects are available for other platforms, like Mono on Linux.

MainMa
A: 

There are some .net implementations on linux maybe on other systems would be compiled as well.
It's called Mono.

bua
Mono supports Mac OS X, Linux, Windows and Solaris. See http://www.go-mono.com/mono-downloads/download.html
Michael Shimmins
+1  A: 

There is a cross platform implementation called "mono". The original .NET releases from Microsoft are Windows only.

More info about the mono project: http://en.wikipedia.org/wiki/Mono_Project

softcr
+3  A: 

Taken from wiki:

  • No. DotNet is not platform independent.
  • Microsoft .NET runs on Windows natively. However an open source implementation, Mono, allows for it to run on open source systems. It, however, doesn't support all .NET classes, so don't expect anything to run completely there.
  • As you all know that in .NET, there are different compilers like for C# - CSC VB - VBC etc. After your code is complied it will convert to MSIL code which is independent. This MSIL code will be go to CLR & this CLR is platform dependent i.e for Unix platform, you should have Unix-type of CLR, for Windows like the same so we can say that .NET code is platform independent.
Sachin Shanbhag
See Cumbayah's answer: .NET is not platform independent, the same way that Java's windows implementation is not platform independent.
RCIX
@RCIX - My answer too says that .NET is not platform independent, but then as Cumbayah says, it really depends on what you define as platform. Considering OS as platform, .NET is not platform independent. But considering CLR as platform .Net code is platform independent. So can you explain what is not clear in my answer?
Sachin Shanbhag
The way you worded it is very confusing, saying that .NET is not platform independent then if you consider that other thing then it is. :S
RCIX
@RCIX - Actually its taken from WIKI link as pointed out. Probably it is combination of answers from different people I believe.
Sachin Shanbhag
+10  A: 

It's really a matter of how you define "platform".

E.g. .NET is platform independent as long as the platform is .NET, the same way that Java is platform independent as long as the platform is Java. That is to say, .NET (and Java) are, in part, platforms in themselves (CLR, JVM). As long as there is an implementation of that platform available for a given physical platform, yes, you can run the compiled code on it independently.

In the end, "platform independence" is, just as "write once, run anywhere", marketing. But in practice, currently, there are JVM implementations available for a lot more concrete platforms than .NET (although initiatives such as the Mono projects aims to change that).

Cumbayah
Well, .NET/Mono runs on most common CPU's currently available, and Wii/ps3/x360.
Dykam
A: 

.Net works fine on MacOSX and Linux as long as you stick to .Net 2.0. Some newer features like LINQ, C# 3.0 etc have also been implemented. You need to take into consideration that file paths, file permissions etc are not working 100% similiar in different platforms.

Forgot to mention that I'm talking about Mono.

jgauffin
A: 

During compilation of .NET programming languages, the source code is translated into CIL code rather than platform or processor-specific object code. CIL is a CPU- and platform-independent instruction set that can be executed in any environment supporting the Common Language Infrastructure, such as the .NET runtime on Windows, or the cross-platform Mono runtime. In theory, this eliminates the need to distribute separate binaries for different platforms and CPU types. CIL code is verified for safety during runtime, providing better security and reliability than natively compiled binaries. The execution process looks like this: Source code is converted to Common Intermediate Language, CLI's equivalent to Assembly language for a CPU. CIL is then assembled into bytecode and a .NET assembly is created. Upon execution of a .NET assembly, its bytecode is passed through the runtime's JIT compiler to generate native code. (Ahead-of-time compilation eliminates this step at run time.) The native code is executed by the computer's processor. However Microsoft has made several improvements which run on .NET which are garnered specifically for windows leaving Mono (its linux based counterpart) much further behind.

Elixir
A: 

.NET is platform independent, since it can be run on more than one version/flavor of OS (Ex: MONO runs various .Net framework versions on many popular operating systems. refer http://mono-project.com/Compatibility)

Narendra Kamma
.NET 1.2 on Linux? Mono currently supports a heap of .NET 3.5 and the upcoming release of 2.8 supports 4.0. To say that Mono isn't a serious implementation is just wrong. There are quite a few people working on Mono for commercial development (including MonoTouch - .NET implementation on the iPhone).
Michael Shimmins
@Michael, Agreed. Here is Mono compatibility chart http://mono-project.com/Compatibility
Narendra Kamma
+2  A: 
stakx