在遵循以下指南之后,我正在构建一个Xamarin.Forms.MacOS应用程序:https://learn.microsoft.com/sv-se/xamarin/essentials/get-started?tabs=windows%2Cios
在这个应用程序中,我想使用Xamarin.Essentials。我可以成功地将这个包添加到我的macOS projcet中,但是在启动过程中,我收到了以下错误消息:
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);
在public override void DidFinishLaunching(NSNotification notification)方法中,AppDelegate文件中的macOS,但它有一个问题,找到.Platform的引用。
如何使Xamarin.Essentials为Xamarin表单的macOS工作?
发布于 2020-07-15 15:28:02
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 support #111
注意:这可能会在v1.6版中发生变化,但它仍未在正式文档:https://learn.microsoft.com/en-us/xamarin/essentials/platform-feature-support中列出
注意:有一些“非官方的”叉子提供了对macOS相当完整的支持,您需要克隆,可能是合并w/官方回购并自己构建它。查看以上支持macOS的个人分叉的github问题。
https://stackoverflow.com/questions/62918167
复制相似问题