【发布时间】:2020-07-16 00:27:22
【问题描述】:
在遵循本指南之后,我正在构建一个 Xamarin.Forms.MacOS 应用程序: https://docs.microsoft.com/sv-se/xamarin/essentials/get-started?tabs=windows%2Cios
在这个应用程序中,我想使用 Xamarin.Essentials。我可以成功地将这个包添加到我的 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.
我已经尝试添加代码sn-p:
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
在 macOS 的AppDelegate 文件中的public override void DidFinishLaunching(NSNotification notification) 方法中,但是在查找.Platform 的引用时出现问题。
如何让 Xamarin.Essentials 为 Xamarin 表单在 macOS 上工作?
【问题讨论】:
标签: c# xamarin xamarin.forms