Adding Module Dependency and addressing
The Project contains some Modules and a Domain
Here I'm using Unity DirectoryModuleCatalog.
We Need ModuleX (Entity Data) to be a dependency of Domain Module.
The first strategy I've used is Registering Modules via Directory.
Don't know whether should I change it or not:
Code :
protected override IModuleCatalog CreateModuleCatalog() { var moduleCatalog = new DirectoryModuleCatalog(); string stPathStartup = Environment.CurrentDirectory; // Shell Project Dir string stPathModules = Directory.GetParent(stPathStartup).Parent.Parent.Parent.FullName + "\\Build\\Modules"; moduleCatalog.ModulePath = stPathModules; return moduleCatalog; }
Not sure but as an alternative to solve this via App.Config :
<configuration> <modules> <module assemblyFile="../Modules/Xz.Domain.dll" moduleType="Xz.Domain,Xz.Domain" moduleName="Xz.Domain"> <dependencies> <dependency moduleName="Xz.Dictionary" /> </dependencies> </module> </modules> </configuration>
Is it the only solution ?
Did I do it right ?
Yet I didn't remove the "CreateModuleCatalog".
Assembly Name and Namespace : Xz.Domain
Project Name shown in the Solution List : Domain
Questions :
How can I Set the Domain Module's Dependency to ModuleX ?
And be sure the ModuleX were loaded before the Domain Module.
------------
The Folder and Project structure is as below:
Modules > ModuleX
Domain --> The App.Xaml shown is here
Shell
--
The Build Folder is one Level up from these
The solution file (sln) is 3 Levels up from these
Thanks for any help.