柳生飘絮 SupperSdr

知识在于积累
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

解决Prism加载module问题

Posted on 2009-08-19 16:56  柳生飘絮  阅读(1282)  评论(0)    收藏  举报

错误提示信息:

An exception occurred while initializing module 'IndexModule'.

 - The exception message was: Activation error occured while trying to get instance of type IndexModule, key ""
    Check the InnerException property of the exception for more information. If the exception occurred
    while creating an object in a DI container, you can exception.GetRootException() to help locate the
    root cause of the problem.

因为在'IndexModule'中存在两种初始化方法,导致加载这个Module的时候框架不知道应该去执行哪个方法,故此引发的异常,特别注意Bootstrapper这里的IModuleCatalog方法因为该方法只包含'IndexModule'故此只对'IndexModule'进行了限制,在其他的Module中可以定义多个初始化方法并无限制。

IRegionViewRegistry 和IRegionManager的作用在加载Module上是相同的,框架内部做了映射!

 

Bootstrapper

 

Code

这两个保留其一即可解决此问题。