As we get into the nitty-gritty of our discussion of Mono’s compatibility with .NET be prepared for some good news and some not so good news. As tradition dictates, we’ll look at the good news first.
Our first bit of good news is that if you want to use Mono to test your applications for compatibility but have little interest in establishing a Linux test environment then you’re in luck. Mono provides a simple Windows executable that will install and configure your system for Mono development. In fact, it’s important to note that Mono has no dependencies on .NET applications or class libraries so you don’t need to have .NET installed on Windows to develop .NET applications with Mono. To download the latest Mono installer head on over to http://www.go-mono.com/download.html and grab the latest version.
Mono currently supports ASP.NET deployment on Linux using either a small, light-weight web-server written in C# called XSP or via an add-on for Apache called mod_mono. Whereas XSP is ideal for experimentation and development scenarios mod_mono is clearly the choice for deployments demanding greater performance and reliability. Currently, Mono’s XSP web-server is not included as part of the Mono distribution. Although downloading the C# source code for XSP is easy enough, actually building the source on Windows is a pain since Mono’s build system is very UNIX-centric in its reliance on “make” files. Since most Windows users don’t have the tools required to compile “make” files I’ve posted the XSP executable at my web-site here. What’s interesting to note is that although I built the XSP executable on Linux it runs just fine under Windows, which brings us to our next bit of good news…
Because Mono’s .NET compatible run-time (officially called the CLI, short for Common Language Infrastructure) is byte code compatible with Microsoft .NET binaries, you can (at least in theory) copy an existing .NET application from Windows to Linux and run it without recompilation. Likewise, any application compiled using Mono’s C# compiler will also run without recompilation under Windows. Of course, the truth of the matter is that, in either case, if you write your application using assemblies that are not available on the alternative platform you’re going to run into problems and therein lies the rub…