Huh. Mono Just Works.
So I continue work on a project which I want to write in .NET but needs to run on Red Hat Enterprise Linux (an ancient version, I'm sure) and Vista. And my home computer is a Mac. Surely this is a recipe for Mono.
I started gingerly, programming in Visual Studio 2005 and building comprehensive unit tests. I run them with Test Runner or NUnit directly in our automated build. Fine.
Then I got a little braver. I installed Mono on our Linux machines. (Long story, actually, and not very amusing. It had to be compiled from source and one of the source files edited because this version of Linux is so old some of the thread functions now have different signatures. But never mind.) Not wanting to jump in whole hog, I simply copied the compiled DLLs from the Windows machine to the Linux machine. Mono comes with a version of NUnit, so I started it up.
linux-machine:/glb/home/myuserid: bin/nunit-console2 MyProject.dll
NUnit version 2.2.0
Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole.
Copyright (C) 2000-2003 Philip Craig.
All Rights Reserved.
OS Version: Unix 2.4.21.47 Mono Version: 2.0.50727.42
......
Tests run: 6 (all pass), Not run: 0, Time: 3.859981 seconds
Tests run: 6, Failures: 0, Not run: 0, Time: 3.859981 seconds
Wow. Just like that. This code isn't exactly running a nuclear reactor, but it is out there multithreading, doing file I/O (with locks), XML serialization, and all manner of fun. Mono even gets Linux's different file naming conventions correct, and thanks to defensive coding of file-handling functions, no change needed on my part. (Hint: learn to love System.IO.Path).
Well, if it works on Very Old Red Hat Linux, surely it'll just work on Mac OS X, right? Yes, why not. I did "svn up" and got the code and binaries down to my little Mac called, er, LittleMac. nunit-console2 reported the same happy results.
One binary, three runtimes.
But why stop there? Why not try the Mono compilers, too? Other than masochism, no particular reason, but I was intrigued by the idea of being able to debug in Linux. After all, the programmers this is supplied to will probably want to occasionally debug the code, and they'll want to do it in Linux as well as Windows. Why not try MonoDevelop? Heck, it's included with Mono downloads. Turns out it's file format compatible with the .sln and .csproj files Visual Studio 2005 uses. I just opened it on the source code I'd downloaded from Windows. I pressed Build, then ran nunit-console2 again. Same results. That was on the Mac.
It just worked. I'm sure my honeymoon will be over soon as I'm just scratching the surface, but I'm very encouraged. Will the auto-generated C++ wrappers for my C# code work just as pleasantly on all these platforms? Stay tuned.

