Prism ModuleDependency ModularityException

1.2k views Asked by At

I am creating a simple Prism 2.1 demo that uses the 'directory search' approach to populating the module catalog. My shell is set up with a Windows Explorer UI; it has a Navigator region and a Workspace region. I have created a NavigatorModule and two workspace modules, WorkspaceAModule and WorkspaceBModule. I have declared a dependency from the NavigatorModule to the two workspace modules.

I am getting a ModularityException with the following message: "A module declared a dependency on another module which is not declared to be loaded. Missing module(s): WorkspaceBModule, WorkspaceAModule." Neither of the workspace modules is load-on-demand, so I am not sure why I am getting this error. If I remove the dependencies from the NavigatorModule, the problem disappears.

Any thoughts or suggestions? Thanks.

Here is the Navigator:

[Module(ModuleName = "NavigatorModule")]
[ModuleDependency("WorkspaceAModule")]
[ModuleDependency("WorkspaceBModule")]
public class NavigatorModule : IModule
{
    ...
}

Here is WorkspaceA:

[Module(ModuleName = "WorkspaceAModule")]
public class WorkspaceAModule
{
    ...
}

And here is WorkspaceB:

[Module(ModuleName = "WorkspaceBModule")]
public class WorkspaceBModule
{
    ...
}
1

There are 1 answers

0
David Veeneman On BEST ANSWER

I found my answer. I had omitted the IModule interface from the workspace module class declarations (see workspace module declarations above). Adding the interface (see the NavigatorModule declaration above) solved the problem.