How to run .NET applications on Linux

Summary:In many enterprise environments we work with a mix of Windows and Linux servers. If you had to build a large, complex enterprise application that runs on Linux, you would typically use Java.

In many enterprise environments we work with a mix of Windows and Linux servers. If you had to build a large, complex enterprise application that runs on Linux, you would typically use Java. Now there's an alternative that's maturing and gaining popularity--you can run .NET applications on Linux, using the open source Mono runtime.

Running .NET applications with Mono on Linux is surprisingly easy. You use Visual Studio 2008 on your Windows PC to build your .NET console application and compile it into an .exe file. Copy the .exe file (say ConsoleApplication1.exe) to the Linux server and run it with the command:

mono ConsoleApplication1.exe

And that's it--Mono will run your .NET binaries without requiring any conversion. Mono supports ASP.NET and WinForm applications too, but be prepared to spend a bit more effort to get them running on Mono.

Installing Mono on your Linux server is easy. If you have EPEL configured on your Linux server, you can run this command to install the Mono runtime:

yum install mono-core

Here's a helpful tip: Mono doesn't trust any root certificates by default, so if your application uses SSL it may fail. You can fix this problem with the command:

mozroots --import

Topics: Servers, Microsoft, Software Development

About

Lee Lup Yuen is passionate about mobile phones and PDAs, as he is constantly buying new gadgets and programming them in J2ME, .NET, Symbian and AppForge. He has developed commercial applications with mobile technologies like SMS, MMS, WAP, 3G video streaming and location-based services.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Related Stories

The best of ZDNet, delivered

You have been successfully signed up. To sign up for more newsletters or to manage your account, visit the Newsletter Subscription Center.
Subscription failed.