Bug in ModuleLoaderService.Initialize?

Topics: CAB & Smart Client Software Factory
Aug 30, 2005 at 10:35 PM
originally posted by: colivier


The exception handling code in ModuleLoaderService.Initialize reports the wrong module name when an exception occurs during the loading and initialization of a module.

I created an application host with two modules (with no dependencies between the modules). The Start() method of my ModuleA's ModuleInit derivative raises an exception (bug on my part) which propagates to ModuleLoaderService.Initialize when Start() is called. The ModuleLoaderService.Initialize method reports incorrectly that ModuleB has a problem.

I've stepped through ModuleLoaderService.Initialize and found the following code:
> throw new ModuleLoadException(modulesindex.AssemblyFile, ...

The problem is that the modules are not loaded and initialized in the order that they appear in the "modules" variable so "index" is pointing at the wrong module.

The "metadata" variable (in ModuleLoaderService.Initialize) actually contains the correct order as determined by the GetLoadSequence method (and indirectly the ModuleDependencySolver class) earlier in the Initialize method.

This applies to Technical Preview 1 as posted on 06/30/2005.

If all of this is not clear please mail me and I'll try to explain better and provide an example.

Aug 31, 2005 at 7:36 AM
originally posted by: BradWilsonMSFT

We also discovered this bug and it's on our list to be fixed.