51

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?

Johan Boulé
  • 1,936
  • 15
  • 19
Nir
  • 29,306
  • 10
  • 67
  • 103

10 Answers10

14

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.

Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
9

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.

  • 2
    Thanks, this sounds like a good possibility (silverlight 3 didn't exist when I asked the question), do you use the same xaml and cs files on both platforms? – Nir Aug 13 '09 at 09:00
8

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.

Iain M Norman
  • 2,075
  • 15
  • 30
  • 4
    This is a nice example story to new developer in my opinion. Pick tools that can be used on multiple platforms. Otherwise you will just find your self in a pickle once the requirements change and execs want the product on Mac or Linux also. – Kaspar Oct 09 '17 at 11:27
5

You can use Parallels. I have our office software written in C# and WPF and people use it on Mac under Parallels all the time.

As a further note, Parallels lets you run Windows Applications side by side with Mac OSX applications, visible in their own window on the Mac desktop. It also allows copy and paste and drag and drop between Mac and Windows apps.

dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
Kelly
  • 6,992
  • 12
  • 59
  • 76
3

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.

Rick
  • 3,361
  • 1
  • 22
  • 29
2

You can try Nevron Open Vision. It integrates in WPF,WinForms,Silverlight and MonoMac, Xamarin.Mac projects. This is not like running a WPF application on the Mac, but will rather require you to recode your application on the NOV platform. However once you do that your application (or modules) will run on all these platforms from a single code base. A nice example of this approach working is Nevron Writer (part of Nevron Office). It runs on Windows, Silverlight and Mac from a 100% single code base.

[Disclosure: I Work for Nevron]

  • I downloaded demo....we will see, but at the moment there does not seem to be Visual Designer + XAML support, it appears that everything has to be done in C# code (that is, the entire GUI has to be created via C# code, you can not use the visual designer) – SirPaulMuaddib Mar 25 '19 at 23:08
1

Actually, there's a CrossOver for you. Other people who answer view from programmer's point. IF I were you, I'll install CrossOver then install .NET 3.5 inside CrossOver and happily run the WPF software.

http://www.codeweavers.com/products/cxmac/

or if you prefer a free (but more difficult) solution, try wine.

http://davidbaumgold.com/tutorials/wine-mac/

VOX
  • 2,883
  • 2
  • 33
  • 43
  • 2
    This is a good idea from the customer point of view - I don't know if my software runs under CrossOver but I know some people run my software under Parallels -- but -- from a software vendor point of view (especially with inexpensive software) I can't just install CrossOver on my customer's computer (especially when CrossOver Pro is more expensive than my software) – Nir Jul 03 '10 at 20:38
  • 1
    Just want to clarify difference between Parallels/VMWare and Wine/CrossOver. Parallels or VMWare is a virtual hardware emulators that can boot Windows. They emulate hardware. Which you need to boot Windows (require Windows license too) and then run your software on emulated hardware that is running windows. Wine/Cross over is about something that rewrote Windows environment on Mac/Linux. It gave your program everything your program expect from a Windows OS. And your program runs at native speed without needing to boot Windows nor require it's license. – VOX Jul 04 '10 at 14:54
  • 3
    How can you suggest Wine as an answer without doing any research whatsoever? Have a look here, you will see .NET 3.0 or over is still not working on Wine (May 2011) and you replied a year ago: http://appdb.winehq.org/objectManager.php?sClass=application&iId=2586 – Nikolaos May 20 '11 at 12:10
  • 4
    Also, how can you suggest CrossOver as an answer without doing research? Have a look here, CrossOver does not even support .NET 2.0 (as of May 2011) where as you replied a year ago: http://www.codeweavers.com/compatibility/search/?name=.net+framework – Nikolaos May 20 '11 at 12:15
  • I never seen those middle-layer simulators are working properly and completely. Even whole hardware emulator like Parallels or VMWare sometimes fail for unknown incompatibility. – eonil Dec 11 '12 at 05:14
  • Well, it's 2021 right now, but CrossOver seems to work with .NET 4.7.2 (at least). – Gwyneth Llewelyn Jan 11 '21 at 13:25
1

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.

adabru
  • 674
  • 7
  • 13
1

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.

Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
1

I had the same problem with WPF and found a more simple/secure solution. I ended up using Unity to create a C# UI interface that works on MacOS, Windows, and more. Here is a basic tutorial I made on how to do it: https://medium.com/@A51/how-to-easily-develop-a-c-ui-app-that-works-on-mac-and-windows-8eaf32ea0ed6. I am happy to help with any questions I can.

Bronson S
  • 11
  • 2