Can we run a C#/WPF application on Mac OS X?

Viewed 80731

I sell a C#/WPF application (targeting .net 3.0 at the moment) and people keep asking me for a Mac version.

The application is a time tracking application with a good GUI, there isn't that much business logic in a time tracking application so most of the application is GUI - rewriting just the GUI is equivalent to rewriting the entire application

I don't have the resources to rewrite the application or maintain two different code bases, so I need a way to run the same code on a Mac (I know I'll have to debug and modify the code, what I mean is I can support only one code base, I can't split the project into different Mac and Windows projects - I just don't have the time to work on two projects).

Porting the application to a cross-platform UI library, to a different programing language or to Silverlight are all not relevant - it will take too much time and I think I'll get more sales by investing this time in new features.

Does anyone know of a tool that can run or port C#/WPF to the Mac?

9 Answers

There's absolutely no way you can run full-fledged WPF app on Mac. I'm not even sure if this is possible in Parallels. The best thing you can do is to use Silverlight, which was previously named "WPF/E" and does run on Macintosh.

We had a similar issue. We wrote a Mac version in Silverlight 3 (which supports quite alot of WPF .NET stuff). It was sandboxed but if this isn't a problem, you can do some nice stuff. Our codebase is now on WPF and Silverlight 3 and is the same, when we compile it produces the SL3 and Desktop apps.

We were in a similar situation. We had a working Windows project and wanted a Mac version.

Our product was in two parts, one a .Net application, the other a Director projector app.

The Director app should be easy right, cross platform and all? Well nope, it rarely is that easy, we ended up with two versions of the Director source file.

Getting the .Net app running required using Mono for the underlying engine, which worked well for us as we were only number crunching byte arrays really. The UI on the otherhand we had to rewrite in Cocoa. It cost us nearly as much as making the Windows version did, as we also had to learn all the Mac stuff as we went.

Since then we've only updated the Windows version.

You want a new feature (support a entire different platform) and you wish to put no effort in it. Sorry, most of the time that will not work.

Besides the most basic (native) .NET stuff with mono, I do not think you can run a WPF application natively on MacOSX.

If you think you can make more money by gaining Mac users. You might consider using other presentation methods. Due to your current 'investment' I'd say try Silverlight (yes, I read your rant about not doing so). Another option could be Adobe AIR / Flex.

If you port your application this way. You can maintain a single codebase.. one that runs on both platforms.

If you wish to spend more time on new features in your current codebase: ignore the Mac users.

It cannot be done. But since your UI is in WPF, what you could do is transform XAML into something else - like GTK# for example. Of course, if you're like me and use lots of .NET 3.5 functionality, that won't help you much.

One more reason to keep your UI in plain, simplistic XML to start with.

Another commercial solution is NoesisGUI (free for <100K gross annual revenue). It is a cross platform UI framework based on WPF/XAML. There is a guide for migration from WPF.

Related