将 Xamarin.Forms 个 macOS 项目添加到 PC 上的解决方案

Add a Xamarin.Forms macOS project to a solution on a PC

有什么方法可以在 PC 上将 Xamarin.Forms macOS 项目添加到 Visual Studio 上的解决方案中吗?我已经有了 iOS 等项目的解决方案。我可以将 macOS 添加到解决方案中吗?

我找到了一个答案 here 似乎说这是不可能的。但我认为答案的推理是错误的。当然,我们需要 Mac 来构建应用程序,但 iOS 也是如此,它 可以通过将它连接到 Mac.

在 PC 上使用它

(顺便说一句,有人知道 macOS 是否已准备好投入生产了吗?)

微软官方documentation给你答案。不幸的是,不可能像处理 iOS 个项目那样完全处理 Visual Studio:

Xamarin.Mac projects (macOS desktop apps) can be opened in Visual Studio and compiled to check for errors, but Mac applications cannot currently be built for distribution in Visual Studio.

此外,Xamarin for Visual Studio 4.2 的 release notes 声明如下:

Xamarin for Visual Studio has gained minimum support for Xamarin.Mac. This release enables Visual Studio to load and recognize Xamarin.Mac projects as supported. However, this minimum support allows only to build Xamarin.Mac projects without using the native Mac tool chain. The build process is performed locally on Windows, generating IL assemblies that cannot be used for running or debugging apps, and it doesn't create application bundles.

我们目前的版本是 4.11,自 4.2 以来没有任何关于对 macOS 项目的扩展支持的消息。现在,您只需要最低限度的支持即可。