【问题标题】:Embedded images in PCL do not show in UWP release buildPCL 中的嵌入式图像未显示在 UWP 版本构建中
【发布时间】:2017-09-22 16:09:14
【问题描述】:

我发现了一篇关于在 Xamarin 中处理图像的优秀文章。它提到了将图像嵌入 PCL 的选项 https://developer.xamarin.com/guides/xamarin-forms/user-interface/images/

我已经用 PCL 中的嵌入式图像构建了我的解决方案,并在 UWP 下以调试模式运行它。图像显示正常。然后我选择了发布版本。应用程序构建并运行良好。但是,图像不可见。

为了调试,我借用了一个代码来检查嵌入式图像。

    var assembly = typeof(App).GetTypeInfo().Assembly;
    foreach (var res in assembly.GetManifestResourceNames())
    {
        System.Diagnostics.Debug.WriteLine("found resource: " + res);
    }

在调试 DLL 中,它们都已就位。在发布构建资源是空的。可能是什么原因?非常感谢任何建议。谢谢。

【问题讨论】:

    标签: c# xamarin xamarin.forms


    【解决方案1】:

    我遵循Why are my Xamarin UWP Images not showing up on device?(由ArbiterUnknown 提供)的建议,在主UWP 应用的Release 配置的Properties 的Build 选项卡上关闭了“Compile with .NET Native tool chain”,它解决了我的问题.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-22
      • 1970-01-01
      • 2017-11-22
      • 2018-11-13
      • 1970-01-01
      • 2012-07-04
      • 1970-01-01
      • 2017-12-13
      相关资源
      最近更新 更多