I ask this question because I have read on "Sams Teach Yourself C# in 21 Days", on page 16, it said "If you wrote a C application and you wanted to run it on Linux machine and a Windows machine, you would have to create two executable program - one on a Linux machine and one on a Windows machine. With C#, you create only one executable program, and it runs on either machine" ..
but I am not sure .. is it possible or not? because C# need CLR and .NET platform for running (pls correct me if I'm wrong), I need more clarification for this..
Originally posted by Winanjaya I ask this question because I have read on "Sams Teach Yourself C# in 21 Days", on page 16, it said "If you wrote a C application and you wanted to run it on Linux machine and a Windows machine, you would have to create two executable program - one on a Linux machine and one on a Windows machine. With C#, you create only one executable program, and it runs on either machine" ..
but I am not sure .. is it possible or not? because C# need CLR and .NET platform for running (pls correct me if I'm wrong), I need more clarification for this..
thanks a lot in advance
Regards
Winanjaya
When you compile a C# program on Windows, it creates a windows executable, designed to run on Windows.
I think you just interpreted it wrong. It looks like they're trying to say, you have to program 1 for Windows and 1 specific for Linux to work, where as C# you only write 1 program and it'll work on both. Even though that is a very false statement....
That or it ment you could execute Win32 executables on Linux. I never ran Mono or anything, but I'm pretty sure it doesn't create a windows executable.
Actually C# is compiled into MSIL code, which is ran by the .NET Framework. Mono is an open source implentation of the .NET Framework. With Mono you will be able to run the same .NET executable on Windows, Mac, Linux, etc.
Here is a screenshot of a simple app I wrote in C#, compiled it with VS.NET, and ran it on Mono in Windows. The Windows.Forms is not complete in Mono yet, so don't experct to be running full applications just yet.
Version 1.0 of Mono is due out in the first quarter of 2004. It will be fully supporting ASP.NET. Yes, that means you will be able to use Linux, Apache web server, and Mono to host ASP.NET Web Applications. No Windows required, and all FREE web server software!!
The Windows.Forms will be completed in a further release.
The idea is that you will be able to compile a .NET application on either Mono or .NET and it will run on both Mono and .NET. Eventually .NET applications wont require Windows to run.
Still, the current assembly linker creates a Win32-style executable file, so the mono project probably needs a kernel module (the same as Wine likely) to run those files.
Don't know about Mono's linker, it might create ELF executables.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
There is nothing Win32 about .NET Exe's, except for when you specifically use Win32 API calls in your code. That is why Microsoft does not recomend the use of unmanaged code.
Currently, the Windows.Forms implementation in Mono is using Wine, but only because it is easier that rewriting it.