Linked by Thom Holwerda on Mon 6th Oct 2008 10:37 UTC, submitted by John Mills
Mono Project The Mono project has released Mono 2.0. As most of you will know, Mono is an open-source implementation of Microsoft's .NET framework for Linux, Mac OS X, Windows, and other operating systems. The 2.0 release comes packed with new features, the main ones being the compiler upgrade to C# 3.0 with support for LINQ, as well as the inclusion of ADO.NET 2.0, ASP.NET 2.0 and System.Windows.Forms 2.0. The release notes detail all the changes and new features.
Thread beginning with comment 332663
To read all comments associated with this story, please click here.
Ignorant me
by sb56637 on Mon 6th Oct 2008 15:28 UTC
sb56637
Member since:
2006-05-11

Excuse my ignorance, but how useful is Mono for porting .NET apps to Linux without modifying the source? For example, Paint.NET would be a nice program to have under Linux. Can we just take the source and compile it with Mono without hacking the source?

Reply Score: 5

RE: Ignorant me
by fretinator on Mon 6th Oct 2008 15:46 in reply to "Ignorant me"
fretinator Member since:
2005-07-06

Excuse my ignorance, but how useful is Mono for porting .NET apps to Linux without modifying the source? For example, Paint.NET would be a nice program to have under Linux. Can we just take the source and compile it with Mono without hacking the source?

As mentioned in the article (imagine that!), Paint.NET used PInvoke - that is, it calls into native Win32 code. To me, that is normally a huge mistake. Unfortunately, it is often necessary, as the .NET libraries do not provide everything you need. At times, you still need native code to get a particular task done. Thus, these call to native code would probably have to be "forked" for other execution environments like Linux and Mac.

Reply Parent Score: 3

RE: Ignorant me
by jstedfast on Mon 6th Oct 2008 16:01 in reply to "Ignorant me"
jstedfast Member since:
2007-06-21

Excuse my ignorance, but how useful is Mono for porting .NET apps to Linux without modifying the source? For example, Paint.NET would be a nice program to have under Linux. Can we just take the source and compile it with Mono without hacking the source?


You don't need to recompile fully-managed .NET apps to get them to run on Linux under Mono. They will Just Work.

The problem is when a .NET application calls into native c libraries (unfortunately, Paint.NET does this, but people are working on a Linux port of the native library that Paint.NET uses).

Reply Parent Score: 4

RE: Ignorant me
by BrianH on Mon 6th Oct 2008 16:02 in reply to "Ignorant me"
BrianH Member since:
2005-07-06

Paint.NET would be a nice program to have under Linux. Can we just take the source and compile it with Mono without hacking the source?


It all depends on whether the original program uses P/Invoke calls to native code dlls, or uses APIs that aren't supported yet. If not, there is a good chance that the binaries will run without change or recompile.

In the case of Paint.NET you are out of luck for now: There are a lot of P/Invoke calls but almost everything else works as of the new release - it's even shown in the release notes. It's funny that most everyone uses Paint.NET for an example when they are asking this question.

There aren't that many popular .NET apps for Windows either, or Java, or interpreted languages (the aforementioned are not interpreted). That's to be expected though. As with any platform in wide use, most Windows apps are not the "popular" type: They are either internal business apps, or tiny utilities that wouldn't need to be ported.

Reply Parent Score: 1

RE: Ignorant me
by miguel on Mon 6th Oct 2008 17:58 in reply to "Ignorant me"
miguel Member since:
2005-07-27

Excuse my ignorance, but how useful is Mono for porting .NET apps to Linux without modifying the source? For example, Paint.NET would be a nice program to have under Linux. Can we just take the source and compile it with Mono without hacking the source?


Paint.NET makes extensive calls to Win32.

But luckily it has isolated all of that code into a library that can be swapped out. The Mono-Paint project on code.google.com has a reimplementation of that library.

As for other applications: out of the data that we received over the past year for about 6,000+ applications, 45% of them will work unmodified (no recompilation necessary, just run the binary directly) on Linux.

The others will require minimal changes. Its equivalent to porting software from Linux to MacOS or viceversa.

Reply Parent Score: 7