Bring VS2012 C# project to OS X

Discussion in 'Mac Programming' started by Sven11, Sep 27, 2013.

  1. Sven11 macrumors 6502a

    Joined:
    Sep 25, 2010
    #1
    How do I make a VS2012 C# project (WinForms) compatible with OS X? Is it possible at all?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  3. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #3
    It's way, way easier to port a program that you designed to be portable in the first place, instead of trying to port a completed project over
     
  4. Niklas Korz macrumors newbie

    Joined:
    Oct 7, 2013
    Location:
    Germany
    #4
    You should probably check out Mono and MonoDevelop. It even has the possibility to put your program into an OS X App bundle.

    If you want to put it on the App Store, make sure to include the Mono runtime.
    Maybe you should consider writing a separate OS X UI. You can still use C# for this, thanks to MonoMac.

    http://www.mono-project.com/Main_Page
     
  5. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #5
    If your UI is abstracted enough from the core of the program you might be able to just make a new UI.

    That assumes the core of your program is all C/C++ and no C#
     
  6. SkywiseNL macrumors newbie

    Joined:
    Oct 7, 2013
    #6
    A few days ago I came across Xamarin.
    You can check that out.
     
  7. dernhelm macrumors 68000

    dernhelm

    Joined:
    May 20, 2002
    Location:
    middle earth
    #7
    You're probably looking at a rewrite.

    Mono is OK - but only supports a subset of the .Net libraries, so unless you built your C# project with mono compatibility in mind, you'll still have some porting to do, anyway.

    Here's a page describing the subset of libraries mono supports:
    http://www.mono-project.com/Compatibility

    If you wanted mono compatibility on Linux or OS/X, you'll probably also want to make sure you are compiling wih /clr : pure.

    All that said, though, depending on the code base, I'd probably just port it to C++ or Objective-C. It'll give you the best native performance on OS/X and you'll get a change to rethink the code as well. Of course, from a time perspective, this is the most expensive option.
     

Share This Page