locked
XamMac / Xamarin.Mac 64bit -- How? RRS feed

  • Question

  • User270642 posted

    In case others go through what I went through, below are the things I experienced. I have since resolved my problem with the following steps:

    1. Manually removed all prior Xamarin frameworks, and cleaned up all relevant installation receipts.
    2. Upgrade to macOS Sierra
    3. Upgrade to Xcode 8.1
    4. Upgrade to Xamarin Studio 6.1.1.17, check for updates, updating all packages.
    5. Recreate solution and manually port over relevant changes.

    Problems I experienced by NOT upgrading (Xamarin Studio 6.1.1.15, macOS 10.10, Xcode 8)

    1. there were no Xamarin.Mac features (project types) available, even though the feature had been installed.
    2. there was no method to specify the Processor Architecture of the resulting .NET assembly (aka. "Platform Target")
    3. Attempts to coerce Xamarin Studio into running a XamMac project from an older version of Xamarin tools failed with various errors.
    4. I then went down the path of trying to hack a XamMac project to run under 64bit mono from the command-line..

    The lesson I learned is that we shouldn't expect older XamMac-based projects to migrate cleanly to newer versions of Xamarin Studio, and that Xamarin Studio may be dependent on specific versions of macOS and Xcode being installed. When in doubt, create a fresh solution to verify the environment, and if that's not working, the environment is what's bad.

    Thanks!

    Tuesday, November 1, 2016 10:35 PM

All replies

  • User270642 posted

    .

    Tuesday, November 1, 2016 10:39 PM
  • User35201 posted

    Sorry you've run into some pain. Let me break down your post and try to explain/help.

    1) Xamarin.Mac project types not showing up. This is sometimes causes by bad permissions / bad symbolic links. In 99% of cases, reinstalling just the Xamarin.Mac pkg again "fixes" it.

    2) You can set the bitness of a library (Xamarin.Mac or other) in Project Options -> Build -> Compiler -> Platform Target. However, for most Xamarin.Mac project types, you can just set all of the libraries to Any CPU and let the final exe target choose the bitness.

    3) If you had the specific errors, I might be able to comment more. One thing to note is that the Xamarin.Mac and Xamarin Studio versions have to be close enough, or you might see errors (we don't test every combination possible, or the test matrix would be beyond unreasonable).

    4) Since you keep saying XamMac and not Xamarin.Mac, can I assume you mean Classic (XamMac.dll). That will never ever ever run in 64-bit, even if you convinced mono to load it. To begin with, a HUGE number of bindings are just plain wrong, since in Classic every pointer sized thing (NSNumber for example) is exposed as int not nint. In addition, there is significant work we had to do in the runtime to make everything 64-bit friendly.

    If you want 64-bit support, you need to migrate to Xamarin.Mac unified. If you have a classic project, there should be a migration option under the Project menu.

    Also, please consider posting on the forum earlier next time. Extreme steps like blowing away your entire install and recreating your project file are almost never required to solve most issues.

    Thursday, November 3, 2016 1:53 PM
  • User270642 posted

    In my defense I had originally posted a message for assistance, but within the 4 hour window we have to edit our message I had done everything several times over with no success. :smile: I mean.. It was already 3pm Pacific, and I work pretty fast, so waiting for a response would probably have left me a day behind on my work. I think you've still provided helpful info, and had another thread made it clear my environment was borked I would have stopped what I was doing sooner (I reviewed these forums for a couple hours prior to posting.)

    Probably you are right that there were bad links, if this happens to me again I think good advice would be to use locate and pkgutil to scrub any older package installations from the machine before attempting to upgrade/install Xamarin studio/packages (an obvious part of the problem was that re-installing the packages several times had no effect on Xamarin.Mac availability, which should have fixed that problem.) I didn't try manually scrubbing everything from disk until just before performing the macOS upgrade (at that point my goal was to ensure success I could not spend any more time being unproductive, the next step would have been a system reset to factory and a lot of :disappointed: feedback)

    After upgrade+re-install I saw the Xamarin Mac templates, and so I immediately created a sample Cocoa solution which worked just fine. I double checked the old projects, they were still borked, I literally copied files from one project to another and then rebuilt for success. Previous code targeted "Classic" so had to clean up "MonoMac" references here and there. No Big Deal(tm).

    I'm impressed with the tooling today, in any case. It's just shy of having Visual Studio on a Mac. I love it. Thanks!

    Friday, November 4, 2016 12:12 AM
  • User35201 posted

    If you run into any more broken projects, feel free to post the error messages here (and the project if you can). In general we try hard to make our errors recoverable/understandable, so knowing where we fell down is useful.

    Though I will admit Classic (XamMac) has a number of sharp edges. There is a good reason we suggest everyone move to Unified. :)

    Friday, November 4, 2016 1:59 PM