Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile for windows on linux using MonoDevelop

I want to know, because I can't find anything on google, If I use MonoDevelop to compile an application on Linux, can I send the generated executable to a Windows computer and expect it to run? file outputs this:

PE32 executable for MS Windows (console) Intel 80386 32-bit Mono/.Net assembly

so I would expect it to run on Windows out-of-the box. But I sent it to a friend for testing, and it said 'this is not a valid win32 application'. So, what do I need to do? It is just a basic hello world console application in C#.

like image 353
Keelx Avatar asked Jul 25 '11 06:07

Keelx


People also ask

Can you run Winforms in Linux?

Windows Forms (and WPF) are both not supported on Linux with . NET Core and probably never will be. Winforms runs on mono, but that is based on . NET Framework, not .

Is MonoDevelop available for Windows?

MonoDevelop enables developers to quickly write desktop and web applications on Linux, Windows and macOS. It also makes it easy for developers to port . NET applications created with Visual Studio to Linux and macOS maintaining a single code base for all platforms.


1 Answers

You have to have the exact version of Mono installed on the target machine or a matching version of .NET Framework (i.e. if you compiled against Mono 2.10.x, you'll most probably need .NET 4.0). Otherwise you'll get that exact error message.

like image 70
Teoman Soygul Avatar answered Sep 30 '22 09:09

Teoman Soygul