
Originally Posted by
oliver
So you still need wine to run mono apps then.

This is a cross-platform .NET app. It will run on any platform which can run Mono, or Microsoft.NET, or even dotGNU Portable.NET:
Code:
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
This is a UNIX-only app. It can only run on Linux or Mac OS or FreeBSD or Solaris or any UNIX-like OS supported by Mono or dotGNU Portable.NET, and cannot run on Windows, either with Mono for Windows or with Microsoft.NET. It is UNIX-only because it is calling into a C library only available for UNIX, libc.so (the core system C library):
Code:
using System;
using System.Runtime.InteropServices;
class PlatformInvokeTest
{
[DllImport ("libc.so")]
private static extern int getpid ();
public static void Main()
{
Console.WriteLine( getpid () );
}
}
This is a Windows-only app. It cannot run on any OS except Windows - however, it can use Microsoft.NET, or Mono on Windows. It also runs on Wine, if you have a .NET framework for Windows installed in Wine. It is Windows-only because it is calling into a C library only available for Windows, msvcrt.dll (the Visual C++ Runtime):
Code:
using System;
using System.Runtime.InteropServices;
class PlatformInvokeTest
{
[DllImport("msvcrt.dll")]
public static extern int puts(string c);
[DllImport("msvcrt.dll")]
internal static extern int _flushall();
public static void Main()
{
puts("Test");
_flushall();
}
}
Mono on Linux can already handle cases 1 and 2. This post is a means to simplify the execution of number 3, by allowing some integration of Mono inside Wine, so Wine can execute Windows-only .NET apps.