如果显式使用来自同一模块的类型,则 Prism 框架不会加载模块 [英] Module is not loaded by Prism framework if a type from the same module is used explicitly

查看:68
本文介绍了如果显式使用来自同一模块的类型,则 Prism 框架不会加载模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用棱镜 5 框架的 WPF 应用程序.使用 DirectoryModuleCatalog 加载模块.同时,如果我引用引导程序所在的启动项目中的一个模块并使用其中的一个类型,则会跳过加载该模块.

We have a WPF application using prism 5 framework. Modules are loaded using DirectoryModuleCatalog. At the same time if I refer one of the modules in the start up project where bootstrapper is located and use a type from it, that module is skipped from loading.

看起来棱镜框架正在跳过它,因为它已经加载到 AppDomain 中.

Looks like the prism framework is skipping it as it is already loaded in AppDomain.

有没有办法加载模块,尽管启动项目中引用了它的类型?

Is there any way to load the module albeit a type from it is referred in the startup project?

推荐答案

听起来您只是在引用模块,而实际上并未将模块添加到您的模块目录中.要么不需要是模块,要么您需要创建一个聚合模块目录,您可以使用该目录添加多个不同的目录.

Sounds like you are only referencing the Module and not actually adding the module to your module catalog. Either that doesn't need to be a module, or you need to create an aggregate module catalog that you can use to add multiple different catalogs.

这是一个例子:http://compositewpf.codeplex.com/SourceControl/latest#V5/Quickstarts/Modularity/Desktop/ModularityWithUnity/ModularityWithUnity.Desktop/AggregateModuleCatalog.cs

另外,不确定您为什么使用 Prism 5,因为它已经过时且不再受支持.您应该使用 Prism 6.3.

Also, not sure why you are using Prism 5 as that is way out of date an no longer supported. You should be using Prism 6.3.

这篇关于如果显式使用来自同一模块的类型,则 Prism 框架不会加载模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆