微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Silverlight 5.0应用prism的Mef容器总是报错的解决方案

      如果本机安装的是Silverlight 5.0版本,而你要用prism版本的Mef容器,就会一直出错,出错的信息是:Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more @R_929_4045@ion.

       查看详细的错误信息是:System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more @R_929_4045@ion.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_Parts()
   at Microsoft.Practices.Prism.MefExtensions.DefaultPrismServiceRegistrar.GetrequiredPrismPartsToRegister(AggregateCatalog aggregateCatalog)
   at Microsoft.Practices.Prism.MefExtensions.DefaultPrismServiceRegistrar.RegisterrequiredPrismServicesIfMissing(AggregateCatalog aggregateCatalog)
   at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.RegisterDefaultTypesIfMissing()
   at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.Run(Boolean runWithDefaultConfiguration)
   at Microsoft.Practices.Prism.Bootstrapper.Run()
   at SilverlightPrism.App.Application_Startup(Object sender,StartupEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex,Delegate handlerDelegate,Object sender,Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedobj,IntPtr unmanagedobjArgs,Int32 argsTypeIndex,Int32 actualArgsTypeIndex,String eventName,UInt32 flags)

解决这个错误的办法是:把Silverlight客户端的Silverlight版本改为4.0就可以了,我不知道还有没有其它更好的解决方案,如果有请指教了。

但如果你是用Sliverlight 5.0版本,而用prism的Unity容器的话,是没有这个错误的。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐