Schwer zu erkennendes Problem bei der Verwendung von PRISM V4, Silverlight und MEF

Bei der Entwicklung von modularen Anwendung mit Silverlight, PRISM und MEF kann es zu folgenden Fehler kommen:

“…Microsoft.Practices.Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'ModCustomerUI'.

- The exception message was: The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced multiple composition errors, with 15 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.

1) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleInitializer..ctor (Parameter="downloadedPartCatalogs", ContractName="Microsoft.Practices.Prism.MefExtensions.Modularity.DownloadedPartCatalogCollection")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleInitializer'.

2) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager.MefXapModuleTypeLoader (ContractName="Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.

…”

Die Fehlersuche hat sich ein bisschen hingezogen, aber dann war die Lösung einfach und reproduzierbar. Man muss für das Assembly „Microsoft.Practices.Prism.MefExtensions“ die Eigenschaft „CopyLocal“ auf „false“ setzen.

clip_image002

GunnarD