Module dependancy does not correctly resolve

Topics: CAB & Smart Client Software Factory
Sep 8, 2005 at 7:19 PM
originally posted by: MatthewCoad

Module load order is not correct if some modules do not have ModuleInit classes.

To replicate the bug

Create a core module. Give it a ModuleInit class. Declare it as a module in its AssemblyInfo.cs.

Create a dependant module. Declare it as a module in its AssemblyInfo.cs. Declare it as dependant on the core module. Do NOT add a ModuleInit class.

In your ProfileCatalog list the core module, then the dependant module.

Run your program. The Dependant module loads, then the Core module. The GetLoadSequence routine in ModuleLoaderService is specifically putting them out of sequence, even though they start of correct.

Note that this appears to be the reason why Services in Dependant modules that are dependant on Services in the core module do not correctly load if you just use the Service and ServiceDependancy attributes.

The workaround is obviously just add an empty class to the dependant module that inherits from ModuleInit.
Sep 8, 2005 at 7:21 PM
originally posted by: MatthewCoad

P.S. So far I'm really impressed with CAB.
Sep 9, 2005 at 6:32 AM
originally posted by: DLorenz

It looks like the last entry in the ProfileCatalog.xml gets run first, and it goes backwards up the chain. Try moving the core to the bottom and dependant to the top.