C# – supported way to run .NET 4.0 applications natively on a Mac

cmacmononet

What, if any, are the Microsoft supported options for running C#/.NET 4.0 code natively on the Mac? Yes, I know about Mono, but among other things, it lags Microsoft. And Silverlight only works in a web browser. A VMWare-type solution won't cut it either.

Is there any semi-authoritative answer to why Microsoft just doesn't support .NET on the Mac itself? It would seem like they could Silverlight and/or buy Mono and quickly be there. No need for native Visual Studio; cross-compiling and remote debugging is fine.

The reason is that where I work there is a growing amount of Uncertainty about the future which is causing a lot more development to be done in C++ instead of C#; brand new projects are chosing to use C++. Nobody wants to tell management 18–24 months from now "sorry" should the Mac (or iPad) become a requirement. C++ is seen as the safer option, even if it (arguably) means a loss in productivity today.

Best Answer

is there any semi-authoritative answer to why Microsoft just doesn't support .NET on the Mac itself?

The best answer is probably that you don't "just support" .NET on the Mac. You spend hundreds of millions of dollars and several years porting .NET to the Mac.

While some things are fully managed and would not require porting, most things are wrappers around the Win32 API (windows, controls, gdi+, cryptography, active directory, COM, enterprise services, device access, sound, video, codecs, winforms, etc, etc).

Every single one of these would have to be abstracted in the backend and remapped to equivalent native libraries on OSX. Of course, there's not going to be a nice clean mapping, so you also have to write hacks upon hacks to get it functioning exactly the same.

Then there's the issue that these APIs on OSX can be brittle and Apple isn't very good at backwards compatibility, so you get to redo your hacks with every major release (and sometimes minor release and hotfixes), racking up a high maintenance cost.

Basically, it's a tremendous amount of money and work for very little gain on a platform whose owner would be against you doing it anyways. And you don't really want to spend money to help people migrate off of your own platform onto a competitor's.

So you are left with not-perfect cross-platform choices:

  • C++, which will still require porting in the future
  • Silverlight out of the browser, for Microsoft support
  • Mono, which does the work to support a healthy subset of .NET, but isn't Microsoft
Related Topic