Error Extending the ViewSwitchingNavigation Quickstart

Topics: Prism v4 - Silverlight 4
Jan 30, 2012 at 6:27 AM

hi,

I'm trying to extend the ViewSwitchingNavigation quickstart by adding a new project (for example ViewSwitchingNavigation.Task).

I have modified the ModulesCatalog.xaml file:

    <Modularity:ModuleInfoGroup Ref="ViewSwitchingNavigation.Task.xap" InitializationMode="WhenAvailable">        <Modularity:ModuleInfo ModuleName="TaskModule"/>    </Modularity:ModuleInfoGroup>

and created a project (silverlight application) ViewSwitchingNavigation.Task that mirrors how the Calendar application looks.

I'm confused on the error . This is the exception:

+ ExceptionObject {Microsoft.Practices.Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'TaskModule'.     - 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 20 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell
2) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell
3) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell
4) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell
5) 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'.
6) 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'.
7) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager..ctor (Parameter="moduleInitializer", ContractName="Microsoft.Practices.Prism.Modularity.IModuleInitializer")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.
8) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader..ctor (Parameter="downloadedPartCatalogs", ContractName="Microsoft.Practices.Prism.MefExtensions.Modularity.DownloadedPartCatalogCollection")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader'.
9) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell -->  AssemblyCatalog (Assembly="ViewSwitchingNavigation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
10) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell -->  AssemblyCatalog (Assembly="ViewSwitchingNavigation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
11) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.RegionAdapterMappings") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.RegionAdapterMappings".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior..ctor (Parameter="regionAdapterMappings", ContractName="Microsoft.Practices.Prism.Regions.RegionAdapterMappings")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior..ctor (Parameter="regionAdapterMappings", ContractName="Microsoft.Practices.Prism.Regions.RegionAdapterMappings") -->  Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
12) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefTabControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefTabControlRegionAdapter'.
13) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefSelectorRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefSelectorRegionAdapter'.
14) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefItemsControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefItemsControlRegionAdapter'.
15) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefContentControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefContentControlRegionAdapter'.
16) Change in exports prevented by non-recomposable import 'ViewSwitchingNavigation.Calendar.CalendarModule.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Calendar.CalendarModule'.
17) Change in exports prevented by non-recomposable import 'ViewSwitchingNavigation.Calendar.Views.CalendarNavigationItemView.regionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Calendar.Views.CalendarNavigationItemView'.
18) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="navigationContentLoader", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="navigationContentLoader", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader") -->  Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
19) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionNavigationJournal") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionNavigationJournal".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="journal", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationJournal")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="journal", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationJournal") -->  Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
20) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionViewRegistry") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionViewRegistry".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior..ctor (Parameter="regionViewRegistry", ContractName="Microsoft.Practices.Prism.Regions.IRegionViewRegistry")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior..ctor (Parameter="regionViewRegistry", ContractName="Microsoft.Practices.Prism.Regions.IRegionViewRegistry") -->  Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
    Check the InnerException property of the exception for more information. If the exception occurred     while creating an object in a DI container, you can exception.GetRootException() to help locate the     root cause of the problem.  ---> System.ComponentModel.Composition.ChangeRejectedException: The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced multiple composition errors, with 20 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell
2) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell
3) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell
4) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell
5) 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'.
6) 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'.
7) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager..ctor (Parameter="moduleInitializer", ContractName="Microsoft.Practices.Prism.Modularity.IModuleInitializer")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.
8) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader..ctor (Parameter="downloadedPartCatalogs", ContractName="Microsoft.Practices.Prism.MefExtensions.Modularity.DownloadedPartCatalogCollection")' on part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader'.
9) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Modularity.IModuleManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Modularity.IModuleManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.ModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") -->  ViewSwitchingNavigation.Shell -->  AssemblyCatalog (Assembly="ViewSwitchingNavigation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
10) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionManager") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionManager".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Shell'.Element: ViewSwitchingNavigation.Shell.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager") -->  ViewSwitchingNavigation.Shell -->  AssemblyCatalog (Assembly="ViewSwitchingNavigation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
11) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.RegionAdapterMappings") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.RegionAdapterMappings".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior..ctor (Parameter="regionAdapterMappings", ContractName="Microsoft.Practices.Prism.Regions.RegionAdapterMappings")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior..ctor (Parameter="regionAdapterMappings", ContractName="Microsoft.Practices.Prism.Regions.RegionAdapterMappings") -->  Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefDelayedRegionCreationBehavior -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
12) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefTabControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefTabControlRegionAdapter'.
13) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefSelectorRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefSelectorRegionAdapter'.
14) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefItemsControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefItemsControlRegionAdapter'.
15) Change in exports prevented by non-recomposable import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefContentControlRegionAdapter..ctor (Parameter="regionBehaviorFactory", ContractName="Microsoft.Practices.Prism.Regions.IRegionBehaviorFactory")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefContentControlRegionAdapter'.
16) Change in exports prevented by non-recomposable import 'ViewSwitchingNavigation.Calendar.CalendarModule.RegionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Calendar.CalendarModule'.
17) Change in exports prevented by non-recomposable import 'ViewSwitchingNavigation.Calendar.Views.CalendarNavigationItemView.regionManager (ContractName="Microsoft.Practices.Prism.Regions.IRegionManager")' on part 'ViewSwitchingNavigation.Calendar.Views.CalendarNavigationItemView'.
18) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="navigationContentLoader", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="navigationContentLoader", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationContentLoader") -->  Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
19) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionNavigationJournal") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionNavigationJournal".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="journal", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationJournal")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService..ctor (Parameter="journal", ContractName="Microsoft.Practices.Prism.Regions.IRegionNavigationJournal") -->  Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionNavigationService -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
20) More than one export was found that matches the constraint '((exportDefinition.ContractName == "Microsoft.Practices.Prism.Regions.IRegionViewRegistry") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Microsoft.Practices.Prism.Regions.IRegionViewRegistry".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.
Resulting in: Cannot set import 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior..ctor (Parameter="regionViewRegistry", ContractName="Microsoft.Practices.Prism.Regions.IRegionViewRegistry")' on part 'Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior'.Element: Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior..ctor (Parameter="regionViewRegistry", ContractName="Microsoft.Practices.Prism.Regions.IRegionViewRegistry") -->  Microsoft.Practices.Prism.MefExtensions.Regions.Behaviors.MefAutoPopulateRegionBehavior -->  AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
   at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition)   at System.ComponentModel.Composition.Hosting.ExportProvider.OnExportsChanging(ExportsChangeEventArgs e)   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.OnCatalogChanging(Object sender, ComposablePartCatalogChangeEventArgs e)   at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.OnChanging(Object sender, ComposablePartCatalogChangeEventArgs e)   at System.ComponentModel.Composition.Hosting.AggregateCatalog.OnChanging(ComposablePartCatalogChangeEventArgs e)   at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.RaiseChangingEvent(Lazy`1 addedDefinitions, Lazy`1 removedDefinitions, AtomicComposition atomicComposition)   at System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.Add(ComposablePartCatalog item)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleInitializer.CreateModule(ModuleInfo moduleInfo)   at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)   --- End of inner exception stack trace ---   at Microsoft.Practices.Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(ModuleInfo moduleInfo, String assemblyName, Exception exception)   at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)   at Microsoft.Practices.Prism.Modularity.ModuleManager.InitializeModule(ModuleInfo moduleInfo)   at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad()   at Microsoft.Practices.Prism.Modularity.ModuleManager.IModuleTypeLoader_LoadModuleCompleted(Object sender, LoadModuleCompletedEventArgs e)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader.RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader.RaiseLoadModuleCompleted(ModuleInfo moduleInfo, Exception error)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader.HandleDownloadCompleted(DeploymentCatalog deploymentCatalog, AsyncCompletedEventArgs e)   at Microsoft.Practices.Prism.MefExtensions.Modularity.MefXapModuleTypeLoader.DeploymentCatalog_DownloadCompleted(Object sender, AsyncCompletedEventArgs e)   at System.ComponentModel.Composition.Hosting.DeploymentCatalog.OnDownloadCompleted(AsyncCompletedEventArgs e)   at System.ComponentModel.Composition.Hosting.DeploymentCatalog.HandleOpenReadCompleted(Object sender, OpenReadCompletedEventArgs e)   at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)   at System.Net.WebClient.OpenReadOperationCompleted(Object arg)} System.Exception {Microsoft.Practices.Prism.Modularity.ModuleInitializeException}

Developer
Jan 30, 2012 at 1:33 PM

Hi,

I believe that this problem might be related to a class being exported in the container more than once. As a start point, you could check if the Microsoft.Practices.Prism.MefExtensions assembly is  referenced with Copy Local = False in your ViewSwitchingNavigation.Task project.

Take into account that when using MEF this assembly should be referenced with Copy Local = True only once (e.g. the main project), and with Copy Local = False in all other projects.

I hope you find this helpful,

Agustin Adami
http://blogs.southworks.net/aadami


Jan 30, 2012 at 3:04 PM

Thank you.  That was the problem!