Using Mono to port a C# .NET app to OS X?

前端 未结 4 759
旧时难觅i
旧时难觅i 2021-02-19 13:16

Alrighty guys, I\'m writing an application that I want to be cross-platform. Up until recently I\'ve been trying to do this in Silverlight with C# because it also runs on OS X,

相关标签:
4条回答
  • 2021-02-19 13:45

    There are several things you should keep in mind.

    1. you'll have to port any usage of platform depedendent UI code
    2. don't use platform dependentent OS calls (win32 api)
    3. don't use "exotic" libraries (like workflow, sadly ef)
    4. In general: abstract dependencies to such code away, so you can easily replace them with mono-specific libraries. (an adviseable pattern would be MVVM).

    There is a tool called MoMA that will help you with all that. However, take the results with a grain of salt. In any case, just try it.

    0 讨论(0)
  • 2021-02-19 13:55

    Mono project has a page dedicated to how to port applications,

    http://mono-project.com/Guidelines:Application_Portability

    However, it is never enough as your application can be unique in so many ways.

    Try to port it and report issues to Mono guys whenever necessary. Besides, if you work for a firm, consider Mono's commercial support service,

    http://mono-project.com/Support

    0 讨论(0)
  • 2021-02-19 14:01

    In addition to what has been said already, considering that Mono supports a subset of the full .NET functionality, I would probably prefer to develop on Mono, then test against Microsoft's runtime, if the aim is to run on both of those. Otherwise, you run the risk of inadvertantly using some functionality that isn't available in Mono, and have to throw a large chunk of code out the window by the time you get around to doing the cross-platform build and testing.

    0 讨论(0)
  • 2021-02-19 14:02

    Appart from MoMa as mentioned in the other answers you might be interested in MonoMac. With the success of MonoTouch (writing c# for iPhone), there is now also a project called MonoMac to create native UI's for OSX while using .net/mono in the background. Might be interesting for you http://www.mono-project.com/MonoMac, article on Miguel de Icaza's blog: http://tirania.org/blog/archive/2010/Apr-19.html

    0 讨论(0)
提交回复
热议问题