New to most of this, having problem finding Xamarin.Forms.Platform.MacOS

Hi,

I have the goal to create a Xamarin.Forms desktop app on Windows with WPF and on Mac. I have the Windows version going, but on Mac I am unable to install or reference Xamarin.Forms.Platform.MacOS in order to access FormsApplicationDelegate. I've beat my head over this and looked at several examples. The only thing I can think of that seems to be different from most is that I don't have any interest in mobile development. I don't have an iOS or Android project in my solution.

Any help on what to do would be appreciated. The error that I see is:

Error CS0234: The type or namespace name 'MacOS' does not exist in the namespace 'Xamarin.Forms.Platform' (are you missing an assembly reference?) (CS0234)

For the line:

using Xamarin.Forms.Platform.MacOS;

I searched NuGet and also tried enabling prerelease versions and upgrading to 3.2 from 3.1. I can't find that platform package anywhere.

Thanks,

Brent W.

Posts

  • fprimexfprimex Member

    After hours of messing I think I figured it out. I right clicked References for the MacOS version of the Forms solution (called FormsTest.MacOS for me), then selected Edit References. Once in there I went to .NET Assembly and unchecked everything (which included Xamarin.Forms.Core/Platform/Platform.macOS/Xaml .dll) and hit OK. I think I might've also hit refresh, opened / closed VS2017, cleaned and rebuilt (which failed), and also might've removed and reinstalled the Xamarin.Forms package from the Project.

    After all of that, I readded the Xamarin.Forms package to the project and rebuilt. There was no Xamarin.Forms.Platform.MacOS package to install (nor was one needed, I later found). Then I checked the .NET Assembly area and the everything was back that I unchecked earlier. I don't recall if they were checked or not, though. If not, I checked them.

    Finally, I had a build that worked once I added the rest of the code.

    So basically I jiggled every handle I could find.

Sign In or Register to comment.