wpf - 框架 4.7 和 .Net 5.0 应用程序的内容控制区域的最新版本 prism 8.0.0.1909 异常?
问题描述
我创建了一个 WPF .Net 5 应用程序。WPF 应用程序与 Sample 2 Region 演示相同,它是一个 .Net Core 3.1 应用程序。运行 .Net WPF 应用程序时抛出异常,表示无法为 ContentControl 创建区域。
我使用相同版本的 Prism 制作了一个类似的 WPF .Net Framework 4.7 应用程序,并引发了相同的异常。
有没有其他人从任何地方听到过关于这件事的报道?
奇怪的是,如果我去 Sample2 Region 演示并将其更改为 .Net 5 应用程序运行正常。不会发生异常。
InnerException {“创建名为“ContentRegion”的区域时发生异常。异常是:System.Collections.Generic.KeyNotFoundException:类型 System.Windows.Controls.StackPanel 的 IRegionAdapter 未在区域适配器映射中注册。您可以通过覆盖引导程序中的 ConfigureRegionAdapterMappings 方法为此控件注册 IRegionAdapter。\r\n 在 G:\prism 文件夹\prism8net5\Prism-master\src\Wpf\Prism 中的 Prism.Regions.RegionAdapterMappings.GetMapping(Type controlType) .Wpf\Regions\RegionAdapterMappings.cs:line 80\r\n at Prism.Regions.Behaviors.DelayedRegionCreationBehavior.CreateRegion(DependencyObject targetElement, String regionName) in G:\prism folder\prism8net5\Prism-master\src\Wpf\Prism .Wpf\Regions\Behaviors\DelayedRegionCreationBehavior.cs:第 132 行。“} System.Exception {Prism.Regions.Behaviors.RegionCreationException}
解决方案
推荐阅读
- laravel - 使用棘轮 websocket 部署 Laravel Vue 应用程序
- vue.js - 如何修复“结果中缺少产品属性”
- c++ - 如何在 C++ 中以最佳方式循环遍历类成员向量的元素?
- html - 部分链接无法在标签中下载
- java - 使用springboot和entitygraph序列化对象时如何忽略fetch lazy
- bash - 如何解决错误“读取:非法选项 -d”。我希望在 sh 下运行它。有没有替代路线
- r - 如何使用 R 中的递归创建长度为 n 的所有 2^n 二进制序列的矩阵?
- javascript - 如何将 formData 中的裁剪图像发送到 PHP
- julia - 在 Julia 中克隆一个函数
- google-analytics - 查看多个站点的 Google Analytics(分析)数据?