Problem with module loading with Prism on WPF

Topics: Prism v4 - WPF 4
Jun 14, 2011 at 2:32 PM

Hello everybody , I am new to this forum and I have already looked at topics similar to main. The problem is when I try to start the application in different environment, for example another person's pc it throws the exception which I have copied. I have tried to set the CopyLocal but it doesn't work, as another person wrote I tried to set all Prism assemblies' CopyLocal not only MEF's but it doesn't work again. I have tried to use the importing constructor it is not helping me too. I would be very grateful for some ideas how to solve this problem. Thank you in advance !

Type : Microsoft.Practices.Prism.Modularity.ModuleTypeLoadingException, Microsoft.Practices.Prism, Version=, Culture=neutral, PublicKeyToken=xxxxxxxxxxx

Message : Failed to load type for module xxxxxxx

If this error occurred when using MEF in a Silverlight application, please ensure that the CopyLocal property of the reference to the MefExtensions assembly is set to true in the main application/shell and false in all other assemblies.

Error was: Could not load file or assembly 'xxxxxxxx, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: xxxxxxxxxx).Source : Microsoft.Practices.PrismHelp link : ModuleName : xxxxxxxxxxxxxxxxxx : System.Collections.ListDictionaryInternalTargetSite : Void HandleModuleTypeLoadingError(Microsoft.Practices.Prism.Modularity.ModuleInfo, System.Exception)Stack Trace :    at Microsoft.Practices.Prism.Modularity.ModuleManager.HandleModuleTypeLoadingError(ModuleInfo moduleInfo, Exception exception)   at Microsoft.Practices.Prism.Modularity.ModuleManager.IModuleTypeLoader_LoadModuleCompleted(Object sender, LoadModuleCompletedEventArgs e)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefFileModuleTypeLoader.RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefFileModuleTypeLoader.RaiseLoadModuleCompleted(ModuleInfo moduleInfo, Exception error)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefFileModuleTypeLoader.LoadModuleType(ModuleInfo moduleInfo)   at Microsoft.Practices.Prism.Modularity.ModuleManager.BeginRetrievingModule(ModuleInfo moduleInfo)   at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModuleTypes(IEnumerable`1 moduleInfos)   at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesWhenAvailable()   at Microsoft.Practices.Prism.Modularity.ModuleManager.Run()   at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.InitializeModules()   at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.Run(Boolean runWithDefaultConfiguration)   at xxxxx.Shell.App.RunInReleaseMode()

Jun 14, 2011 at 3:49 PM


It could be helpful if you could provide us with a repro sample (for example SkyDrive) of your solution, so that we can help you find out the cause of the unexpected behavior you're experiencing.


Miguel Bronzovic

Jun 14, 2011 at 11:38 PM

What do you mean , when you say repro sample ? By the way , after hours of trying I am thinking that the problem might be that the client doesn't have installed .NET 4.0, but only .NET 4.0 Client Profile and .NET 4.0 Extended , could this be ? Some opinions ?

Jun 15, 2011 at 3:29 PM


Prism’s pre requisites are described here. If your client doesn’t have .NET Framework v4.0 installed your Prism application is not going to work. Please check your client configuration to make sure he is running all dependencies.

On the other hand, a repro sample is an application which the sole porpoise is to reproduce a specific scenario (one is not responding to the expected behavior), to work with and used by others to reproduce and solve the undesired behaviors.


Miguel Bronzovic