【问题标题】:[xamarin][uwp][custom renderer] custom renderer pcl libarary not loading in release mode[xamarin][uwp][custom renderer] 自定义渲染器 pcl 库未在发布模式下加载
【发布时间】:2018-01-07 19:23:37
【问题描述】:

我创建了 PCL 库来保留 UWP 的所有自定义渲染器。 此 PCL 添加到另一个跨平台应用程序。 它在调试模式下工作。

但在发布模式下工作。

需要帮助

问候 苏米特

【问题讨论】:

  • 您在调试模式下遇到什么错误?你可以在这里发帖吗?
  • 调试模式下没有错误。问题是“渲染器 pcl 未在发布模式下加载”

标签: c# xamarin xamarin.forms xamarin.uwp custom-renderer


【解决方案1】:

这是Xamarin.Forms for UWP 的一个已知问题。

要修复它,您必须在启动时注册您的 PCL,如下所示:

// you'll need to add `using System.Reflection;`
List<Assembly> assembliesToInclude = new List<Assembly>();

//Now, add in all the assemblies your app uses
assembliesToInclude.Add(typeof(ClassInYourPCL).GetTypeInfo().Assembly);

//Also do this for all your other 3rd party libraries

Xamarin.Forms.Forms.Init(e, assembliesToInclude);
// replaces Xamarin.Forms.Forms.Init(e);

欲了解更多信息see here

【讨论】:

    猜你喜欢
    • 2020-01-14
    • 2020-03-16
    • 2018-07-26
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 2021-05-01
    相关资源
    最近更新 更多