Can I add a MacOS project in visual studio 2017 for windows?

BillyMartinBillyMartin USMember ✭✭✭

I tried to add a MacOS project to my .Net PCL, but there were no optrions for Mac anywhere.

When I copied my folder entire folder over to my Mac, I was able to add a MacOS project, but none of the other projects were recognized. I moved it back to Windows, and it recognizes the MacOS project now, but doesn't give me any options for debugging.

Is there a way to add a MacOS project to Xamarin Forms 3.0 in Visual Studio 2017?

Best Answer

Answers

  • YuriKuznetsovYuriKuznetsov USMember ✭✭✭

    I heard that Xamarin Forms is want to create app for Mac, but you still need a Mac for debug.
    https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/

  • BillyMartinBillyMartin USMember ✭✭✭

    Thanks, @YuriKuznetsov . I have a Mac and I use it to enable my iOS debugs in Xamarin, but it doesn't seem to work the same way for MacOS. Not sure why it would be any different. Does anyone out there have any experience with this?

  • kentuckerkentucker USMember ✭✭✭✭✭

    I am not aware of any way to create a Mac project on a windows pc

  • BillyMartinBillyMartin USMember ✭✭✭
    edited June 2018

    Thanks, @kentucker ! It's sad that it can't be done AT LEAST the same way we do with iOS. I guess I'll just copy my solution over to the Mac, remove all the projects that Mac is fussing over, and build a Mac app.

    Going to be a pain whenever I make a code improvement, though. I'll have to do it to all over again. ):

    I wonder if Admob and In App Purchase plugins will work on the Mac.

  • BillyMartinBillyMartin USMember ✭✭✭

    Thanks for the info, @ChrisHamons . Guess I'll map my solution to a network drive and hope it's not to slow! Anyone know about in app purchases with Mac?

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai
    edited July 2018

    You likely want StoreKit: https://developer.apple.com/documentation/storekit?changes=_2&language=objc

    which is bound in Xamarin.Mac.

    This looks to be a great tutorial, but is written in Objective-C (and iOS, but I believe the ideas are the same): https://www.raywenderlich.com/122144/in-app-purchase-tutorial

    As always, I suggest reading this documentation to help understand the Objective-C enough to translate it to C#:

    https://docs.microsoft.com/en-us/xamarin/mac/app-fundamentals/mac-apis

  • shapshap USMember ✭✭

    Small addendum to ChrisHammon's reply: you can also create separate build configurations for MacOs Debug, MacOS Release, Windows Debug, Windows Release, and so forth, and then turn the appropriate projects on and off in the respective configurations. I've done that with my current project, though I haven't yet deleted the original Debug/Release configurations - something to try when I have nothing else underway so I can recover from Git. :-)

    I can, however, confirm that adding configurations works well. Add them using Windows VS rather than Mac VS. For reasons I don't understand Mac VS boogers them.

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    I have to admit, I don't understand why Xamarin on a PC can't build a Mac application. I mean, I have the Mac, I have an Apple Developer Licence, and Xamarin merrily fires up XCode on the Mac to build for iOS. Would it really be so much work to get it to do the same for Mac?

    Can I vote for this feature anywhere?

    In game development, for example, it is extremely common, almost routine, for the PC to be the development environment and to remote-debug on whatever the target platform happens to be. I was doing that over twenty years ago on a PS1 and a Nintendo connected to a Windows PC running VS.

    Comment from Xamarin anyone?

    • Patrick
  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    If you wish to provide feedback, may I suggest giving it here: https://developercommunity.visualstudio.com/spaces/8/index.html

    What you are suggesting is technically possible, and it is what we do for iOS. When you build a iOS project on Windows, we remote to a macOS machine and compile over there. This is required, since the toolchain (libraries, clang, etc) for iOS only runs on a mac. If Apple provided the toolchain on other platforms we would likely support this use case without remoting. Fundamentally it would be possible to do this for macOS as well, thought a lot of work.

    However, I'm not sure it would as helpful in many cases as people would suspect. You can easily test your iOS application when working on Windows by deploying to your phone and looking at that. To actually launch your macOS application though, you'd need to be in front of a mac anyway.

    It's a reasonable feature request however, so please feel free to express your opinion in dev community.

Sign In or Register to comment.