【问题标题】:Why is my reference not being compiled in Xamarin Windows Universal PCL?为什么我的参考没有在 Xamarin Windows Universal PCL 中编译?
【发布时间】:2015-12-17 20:50:21
【问题描述】:

我有一个可以在 Android 上成功运行的 Xamarin PCL。我按照说明将 Windows 通用项目添加到此处找到的解决方案:

https://developer.xamarin.com/guides/cross-platform/xamarin-forms/windows/getting-started/universal/

但我在运行它时遇到问题。

当我构建我的 x86 项目时,我收到警告:

warning : Method 'project.ctor()' will always throw an exception due to the missing method 'ImageSource.FromResource(string)'. There may have been a missing assembly.

然后当我运行代码时出现异常

Additional information: Method 'ImageSource.FromResource(string)' was not included in compilation, but was referenced in SturgisMainPage..ctor(). There may have been a missing assembly.

当我构建我的 x64 项目时,我收到了相同的构建警告,但例外是

An exception of type 'System.NotImplementedException' occurred in App1.Interop.dll but was not handled in user code

Additional information: Arg_NotImplementedException

如何确保编译参考。我唯一的参考是说明中的 NuGet 包,即 Xamarin.Forms。

【问题讨论】:

    标签: xamarin reference uwp portable-class-library


    【解决方案1】:

    在添加引用步骤中,我将 Xamarin 2.0 Nuget 包添加到通用项目,但我的可移植类库项目设置为 1.0。我将 Portable Class Library Xamarin Nuget Package 更新到 2.0,然后它运行得很好。

    【讨论】:

      猜你喜欢
      • 2017-03-02
      • 1970-01-01
      • 2016-02-18
      • 2023-03-31
      • 2016-06-13
      • 2019-04-22
      • 2018-02-06
      • 2018-07-07
      • 1970-01-01
      相关资源
      最近更新 更多