Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been asked what it would cost to port a .NET application to Mac.

I don't have enough knowledge to even give a rough estimate. I have not done anything on a Macintosh above surfing the web, and that was 10 years ago. My guess is that we probably have to write it from scratch in java or objective-c.

We are a Windows/Linux shop, and besides forking out for one or two snazzy new iMacs, what else do we need that costs money?

Does anyone have any advice?

share|improve this question

migrated from stackoverflow.com Jul 1 '11 at 9:35

8 Answers

up vote 10 down vote accepted

That depends heavily on the kind of application and your customers.

There are lots of poorly ported applications on the Mac (Java, Qt, Silverlight, Mono), that Mac users dislike and don't use. Personally I think, there is no such thing like "cross-platform" when it comes to UI (well, I know there is, but I think results are unacceptable).

So I recommend to learn Cocoa and Objective-C, but that's definitely possible. The development tools Apple provides are free and great.

share|improve this answer

If you are already using .NET you might as well try migrating to Mono instead of re-writing everything.

share|improve this answer

If your application is built with C#(and possibly VB), you may be able to use Mono. This is a open source .net implementation. See http://www.mono-project.com, and for a development IDE, http://monodevelop.com/

KT

share|improve this answer

It entirely depends on the nature of the app. Do you foresee porting the application to linux eventually? If so, you might want to consider rewriting in a platform-agnostic language.

I personally can't stand Mac applications that are written in Java. They just don't feel right at all. To me, a rewrite in Objective-C would be the best option to make the App feel like a native App.

Objective-C is a great language, and as stated before, the Developer tools are free from Apple.

One more thing to consider: Apple has great support for Ruby and Python as well. There are bridges to allow you to leverage the Cocoa framework in your application. This is all built into the Xcode IDE.

share|improve this answer
1  
Totally agree. The Cocoa-Java bridge has long been deprecated, and don't expect to see it beyond Leopard. Objective-C is the "purest" solution, but you can mix with Python/Ruby/etc. as well. You can try using Mono to leverage existing C# code, but be aware that it's a "square peg in a round hole" proposition from the get-go. – Quinn Taylor Jul 2 '09 at 20:31
1  
Although, to be fair, it is possible to write nice UIs for mac in java (see cyberduck) but it is the exception, no the rule – cobbal Jul 2 '09 at 21:38
Good call. Cyberduck is actually one of my favorite Mac apps :) – Reed Olsen Jul 2 '09 at 21:40

Although you will need Apple hardware, but that's a fairly trivial one-time (or at least infrequent) outlay — as always, the programming effort is what will really cost you money. Whether you start from scratch in Objective-C or leverage existing code via Mono (or some other tool) you will still have development costs. The magnitude of those costs will depend on the approach you choose, the expertise of your developers, and degree of flexibility inherent in the design of your software.

Before you choose any specific approach, definitely look for examples of apps that have ported from .NET to OS X (in whatever form). Be inherently mistrustful of "silver bullet" / panacea tools. Be sure that your chosen approach will support all the critical technologies you use, or that equivalents are available on the new platform. Recoding from scratch can be quite costly, but it's even more costly if you start out trying to port it, only to realize it won't work as hoped and you have to start from scratch anyway. :-)

share|improve this answer

Mono seems like the obvious choice, but the last time I looked into this, their Windows Forms support was practically non-existent. I'm sure it's gotten better, but it'd be worthwhile to take a look at the Mono Project WinForms page to see what the current status is.

Also be aware that Mono (of course) doesn't support P/Invoke to access the native windows API, when running on other platforms. This could be a major problem if your application uses the native API for anything important.

share|improve this answer

It's quite possible to write completely cross-platform .NET code that runs on Windows/Mac/Linux. It's a lot more work, but it is doable. For a good (open-source) example of what is possible, have a gander at Banshee, a cross-platform media player written in .NET.

share|improve this answer
As you say, Banshee is a good example of what's possible. At the same time it's a good example of why you shouldn't try to build cross-platform UIs. – Nikolai Ruhe Jul 3 '09 at 16:27
Now that you mention it, it is rather ugly. Oh well. – Jacob Jul 3 '09 at 16:40

Using mono would seem to be the answer here. I recently looked at mono, and found that Winforms support is missing too much to be useful and WPF is not going to be supported (it would be too much work for the mono deverlopers). For user the interface, you would need to re-code the front-end in a mac-specific mono library such as CocoaSharp. Silverlight might be an option, as there is an implementation of that in mono.

For the UI conversion, it would depend on how well-structured your UI code is. If there is a lot of logic tied into the user interface, i.e. it hasn't been separated out, then it will take longer to get working on a new UI library.

It also depends on whether your app uses domain specific libraries that are windows specific, how much work would be involved in recoding to use different libraries that are either cross-platform, or to write code for interfacing to a mac-specific library.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.