May 4, 2008 at 3:36 PM
Edited May 4, 2008 at 3:39 PM

FYI. When setting up a new project with only the shell configured, and I haven't created any modules yet, the ConfigurationModuleEnumerator EnsureModulesDiscovered crashes on the foreach (ModuleConfigurationElement element in section.Modules). section.Modules is null.

An instance of the ConfigurationStore is created in the InitializeModules method in the Bootstrapper class.
May 5, 2008 at 8:46 AM
Edited May 5, 2008 at 8:46 AM
Thanks planefun

I will forward this on to the team.

May 6, 2008 at 12:57 AM
In trying to understand why this occured, i have been building a Prism Application.

You said you didn't create any modules yet. If so why did the ConfigurationStore get created in the InitializeModules? What code did you run in this function?

When I did this with no modules, I initialized the container and the InitializeModules() didn't call anything since there was no modules for the container to Resolve.

thanks, Larry
May 9, 2008 at 2:13 AM
This is my InitializeModules method from the Bootstrapper.cs file:

private void InitializeModules()
ConfigurationStore store = new ConfigurationStore();
container.RegisterInstance<IModuleEnumerator>(new ConfigurationModuleEnumerator(store));

IModuleEnumerator enumerator = container.Resolve<IModuleEnumerator>();
IModuleLoaderService loaderService = container.Resolve<IModuleLoaderService>();


This calls the GetStartupLoadedModules method in ConfigurationModuleEnumerator which calls the EnsureModulesDiscovered method.