Click here to Skip to main content
13,552,119 members
Click here to Skip to main content
Add your own
alternative version


20 bookmarked
Posted 15 Dec 2012
Licenced CPOL

Running a Windows .NET application on Linux

, 12 Mar 2013
Rate this:
Please Sign up or sign in to vote.
Running the same compiled assembly on Windows and Linux.


Today Mono contains the core development libraries, the development and deployment tools. Most of these are command-line tools and compiler, there is no complete replacement for Visual Studio to do Windows.Forms and ASP.NET applications natively on Linux. 

You can continue to use Visual Studio to develop your applications on Windows, the binaries produced by Visual Studio are binary compatible with Mono, so you only need to get these files to your Linux/Unix server. 

The same compiled assembly will run on Windows and Linux. You can test this by compiling it on Windows, copying the assembly to a Linux machine and running the mono applicationname.exe command there or you can create a batch file.

If you create a batch file, put a check on "Allow executing file as program" in the properties->Permissions: Execute and write the follow code inside the batch file:   

exec mono applicationname.exe 

To run the program click twice in the file or in the command type the name of the batch follow by enter, next click Run. 

If the program is inside a folder type the follow code inside the batch file:

exec mono "./folder name/applicationname.exe" "$@" 

Note: On Windows, the directory path separator is "\" while on Linux it is "/", it is possible to create files that contain a "\" in their names on Linux. 

For more information about portability please check this link: Mono Application Portability.

Note: MonoDevelop is an IDE primarily designed for C# and other .NET languages.

Note: Works in Windows (with .NET Framework installed, except the batch file) and Linux (with Mono installed). 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Nelson Kosta Souto
Portugal Portugal
My name is Nelson Souto, I develop software for fun and profit since 1992.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 3 Pin
Prasad Khandekar13-Mar-13 20:08
memberPrasad Khandekar13-Mar-13 20:08 
AnswerRe: My vote of 3 Pin
Nelson Kosta Souto13-Mar-13 23:20
memberNelson Kosta Souto13-Mar-13 23:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180515.1 | Last Updated 12 Mar 2013
Article Copyright 2012 by Nelson Kosta Souto
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid