繁体   English   中英

Xamarin.Essentials 导致 Xamarin.Forms.macOS 崩溃

[英]Xamarin.Essentials causes crash in Xamarin.Forms.macOS

在遵循本指南后,我正在构建 Xamarin.Forms.MacOS 应用程序: https://docs.microsoft.com/svios-se/tabs=windowsentials

在这个应用程序中,我想使用 Xamarin.Essentials。 我可以成功地将这个 package 添加到我的 macOS 项目中,但是在启动过程中我遇到了以下错误消息:

This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.

我试图添加代码片段:

Xamarin.Essentials.Platform.Init(this, savedInstanceState);

在 macOS 的AppDelegate文件中的public override void DidFinishLaunching(NSNotification notification)方法中,但是在查找.Platform的引用时存在问题。

我如何使 Xamarin.Essentials 适用于 macOS 的 Xamarin forms?

Xamarin.Essentials 目前支持 macOS。 自 2018 年以来,这一直是一个悬而未决的问题,因为该平台没有官方赞助商,也没有 Linux、WinForms 等......

iOS - Supported By Microsoft
Android - Supported By Microsoft
UWP - Supported By Microsoft
macOS
WinForms/WPF
GTK#
Tizen - Supported by Samsung
watchOS - Supported By Microsoft
tvOS - Supported By Microsoft

额外的平台支持 #662

macOS 支持 #111

注意:这在 Essentials 的 v1.6 版本中可能会有所改变,但官方文档中仍未列出: https://docs.microsoft.com/en-us/xamarin/essentials/platform-feature-support

注意:有一些“非官方”分支提供了对 macOS 的相当完整的支持,您需要克隆,可能与官方 repo 合并并自己构建它。 查看支持 macOS 的个人分叉的上述 github 问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM