查看詳細的錯誤信息是: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)
要解決這個錯誤的辦法是:把Silverlight客戶端的Silverlight版本改爲4.0就可以了,我不知道還有沒有其它更好的解決方案,如果有請指教了。
但如果你是用Sliverlight 5.0版本,而用prism的Unity容器的話,是沒有這個錯誤的。