views:

475

answers:

2

How can I organize multiple Composite WPF applications so that they share a single Shell project but populate their module catalogs from different App.config files?

I am writing a suite of applications using Composite Application Guidance for WPF. Each application's functionality is determined by the availability of different modules, which are listed in the Shell's App.config. By giving each application a different App.config, I can specify which modules each application may use.

However I would like to share a single Shell project between all of the applications for common look and feel. Initially I created a Solution for each application, added the Shell project, and then added the relevant modules. The problem is that the common Shell project only has one App.config file, and I cannot change it on a per-Solution basis.

Populating the catalog through code does not avoid this problem--there would still be application-specific code in the Shell that must somehow be activated by the Solution I am using.

A: 

Apart from hard coding modules, and loading modules from the configuration, you can also load modules dynamically from a given directory.

So to set up different "apps" that all use the same shell, I'd create a batch file that copies the right modules for each app to separate folders, thus creating the different applications.

The Composite Guidance Library documentation has more on setting up your project to load modules dynamically from a directory.

Cameron MacFarland
A: 

What I decided to do was to treat the Shell as its own module. Each application has its own solution and project, which contain the individual App.config files. They also have their own Bootstrapper classes. The Bootstrapper in each application instantiates the Shell.

emddudley