Prism 4.1 ModuleInitializeException

Jun 22, 2012 at 6:09 AM

I convert 2 projects which work well in Prism 4.0 to 4.1 then find they are all not work.

When load any assembly, system will throw a ModuleInitializeException.

There are some difference between them?

Jun 22, 2012 at 8:47 AM

The reason is Silverlight 5.0! If I change the project from silverlight 4 to sl5, I will get the error - "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

   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)

 

Prism 4.1 really OK?

Jun 22, 2012 at 8:58 AM

some resolve:

http://www.jamesgyamfi.com/2011/12/migrating-prism-based-application-to.html