[Mono-osx] A very basic question-- running Win .net exe on Mac OS X w/ Mono

Stifu stifu at free.fr
Thu Feb 26 06:01:40 EST 2009


No reason to be "afraid" that I'm right, because as far as I'm concerned,
it's a very good thing Mono doesn't require you to modify your code. :)
Of course, the exception is when something is not supported or buggy in Mono
(I recently read something like 70% of the .NET classes are implemented in
Mono. For the rest, you'd have to look for alternatives, possibly Mono APIs,
which can also run with .NET on Windows), or when directly calling Win32
DLLs, which naturally prevents your app from being cross platform.

And to clear things up a bit: the C# Mono compiler doesn't produce the
*exact* same binary code as the .NET one. Some benchmarks actually show some
things that run faster or slower depending on whether the exe has been
compiled with .NET or Mono. There are also rare bugs where a .NET exe won't
run with Mono on Linux, and a Mono exe won't run with .NET on Windows... but
that's quite rare as far as I know, and probably bound to happen less and
less as Mono gets more mature.


marc hoffman-4 wrote:
> 
> Joanna,
> 
>> Stifu a écrit :
>>
>>> What? Yes, yes you can.
>>> You can use Mono libraries if you want to, but you don't have to.
>>>
>>> My own app uses nothing but MS .NET classes, nothing Mono-specific,  
>>> has been
>>> compiled on Windows with the .NET compiler, and runs fine with Mono  
>>> on
>>> Linux, with no modification.
>>
>> Then it is obviously I who doesn't understand Mono :-)
> 
> i'm afraid Stifu is right. in an ideal case, building an app from  
> source on/against Mono vs .NET should yield the exact same binary, and  
> thus, a binary build on one platform will run on the other. it's  
> really only when you use (purposely or accidentally) stuff that  
> doesn't exist on the other platform, that things fail (and that's the  
> "only' thing that linking against the "right" platform will gain you).
> 
> i've had several occasions where people sent me small demo apps  
> written in .NET and they ran just fine with "mono AppName.exe".
> 
> obviously any *serious* app will sooner or later touch the boundaries  
> of what works on both platforms, so its always good practice, imho, to  
> build and test against both Mono and .NET, if cross-platform is  
> something to care about.
> 
> yours,
> marc
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
> 
> 

-- 
View this message in context: http://www.nabble.com/A-very-basic-question---running-Win-.net-exe-on-Mac-OS-X-w--Mono-tp22217524p22221946.html
Sent from the Mono - OSX mailing list archive at Nabble.com.



More information about the Mono-osx mailing list