StockTraderRI ModuleLoader error at start up

Nov 7, 2008 at 10:25 PM
I just went from drop 2 to drop 4 and opened the above project.  I don't have Silverlight on my box so I let VS give me the startup warnings.  Next I just removed all the Silverlight projects and ran the app from VS.

It failed in the ModuleDependencySolver.Solve method:
"A module declared a dependency on another module which is not declared to be loaded. Missing module(s): NewsModule, MarketModule."

Nov 11, 2008 at 5:01 PM

Hi,

 

The Stock Trader RI has 2 sub-applications.

·         The first is a Desktop application that runs using WPF. You should not have problem to run this.

·         The Second is a Silverlight application, probably you cannot be able to load the project of this application if you do not have installed Silverlight.

 

You might check the InitializeModules method of the StockTraderRIBootstrapper class (in the StockTraderRI project). This is a good place to start to search the source of the problem base in the information that you provided.

By default (when you open the solution for first time), the method should looks like this:

 

protected override void InitializeModules()

      {

#if !SILVERLIGHT

            var enumerator = new Microsoft.Practices.Composite.Modularity.StaticModuleEnumerator()

                .AddModule(typeof(MarketModule))

                .AddModule(typeof(NewsModule))

                .AddModule(typeof(WatchModule), "MarketModule")

                .AddModule(typeof(PositionModule), "MarketModule", "NewsModule");

 

            var moduleLoader = this.Container.Resolve<Microsoft.Practices.Composite.Modularity.IModuleLoader>();

            moduleLoader.Initialize(enumerator.GetStartupLoadedModules());

#else

 

            IRegionManager regionManager = this.Container.Resolve<IRegionManager>();

            var positionModule = new PositionModule(this.Container, regionManager);

            positionModule.Initialize();

#endif

}

 

Based in the exception’s description, I can only reproduce the same exception that you got if I comment the first 3 AddModule lines:

 

var enumerator = new Microsoft.Practices.Composite.Modularity.StaticModuleEnumerator()

                //.AddModule(typeof(MarketModule))

                //.AddModule(typeof(NewsModule))

                //.AddModule(typeof(WatchModule), "MarketModule")

                .AddModule(typeof(PositionModule), "MarketModule", "NewsModule");

 

I do not know if this is your error or something similar, but I hope this can help you to find the problem.

If your problem persists, do not doubt send more information about it. You could also try using the latest drop (drop #5) and see if the problem still persists.

 

Ezequiel Sculli

http://blogs.southworks.net/esculli/