Linked by Thom Holwerda on Mon 6th Oct 2008 10:37 UTC, submitted by John Mills
Thread beginning with comment 332663
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
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.
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).
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.
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.




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?