【问题标题】:Xamarin.Forms UWP project throws exception when compiled with .Net NativeXamarin.Forms UWP 项目在使用 .Net Native 编译时引发异常
【发布时间】:2018-02-19 06:49:32
【问题描述】:

我有 UWP Xamarin.Forms 项目,我在我的 UWP 项目中启用了“使用 .NET Native 工具链编译”选项,但是在运行应用程序时会抛出以下错误:

System.Reflection.MissingMetadataException: ''Xamarin.Forms.Platform.UWP.WindowsPlatformServices' 丢失 元数据。欲了解更多信息,请访问 http://go.microsoft.com/fwlink/?LinkID=392859'

我还在我的 default.rd.xml 文件中添加了以下行:

<Type Name="System.EventHandler" Dynamic="Required All" /> 
 <Namespace Name="System.Reflection" Serialize="Required All" />
 <Namespace Name="System.Private.Reflection.Core" Serialize="Required All" />

【问题讨论】:

  • 你试过用这个solution吗?
  • @NicoZhu-MSFT 是的,我试过了,但没有用,我在 default.rd.xml 中添加了以下行,最后它确实有效:
  • 好的,我可以将您的评论转换为此问题的答案吗?
  • @NicoZhu-MSFT 当然。

标签: c# xamarin xamarin.forms uwp xamarin.uwp


【解决方案1】:

通过在default.rd.xml 文件中添加以下行解决了这个问题。

<Type Name="Xamarin.Forms.Platform.UWP.WindowsPlatformServices" Serialize="Required All" /> 

【讨论】:

    猜你喜欢
    • 2016-11-22
    • 2017-05-18
    • 2019-01-22
    • 2020-01-08
    • 2016-04-17
    • 2018-07-10
    • 1970-01-01
    • 2018-05-08
    • 2019-04-24
    相关资源
    最近更新 更多