I need a conditional compilation switch that knows if I am compiling for the mono or MS .NET runtime. How can I do this?
It is clear that there are times when code on one platform will differ to code on another and you may wish to do this at run-time or maybe compile time. Some times it can't be done at run-time.
For example:
Mono is used as the basis of Xamarin's Ios, Android, and Mac tool kits. While these have a lot of common code they also have classes which only appear on a single platform. When developing with these tool kits you develop native packages which are not exchangeable between platforms.
A simple case is file names and paths. These differ on each platform. I just might to have a little condition to load the strings differently on each platform. Some platforms have case specific file names some don't.
It would be nice if there was a little bit of code which returned the current platform - be it UNIX, iOS, Mac, X86, X64, XBox etc....