I see that you are using Prism v2 (because of the tag you used in the post) and Mokosh's post targets Prism v1 (because he uses some v1 classes IModuleEnumerator, StaticModuleEnumerator). You
might take a look at my post Migrating
Composite Application Guidance (Prism-v2) to XBAP that uses this same approach to migrate the HelloWorld Quickstart in Prism v2.
I followed Mokosh's steps on the HelloWorld quickstart application but couldn't reproduce the same exception you are receiving. Instead I get the following error:
"An exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.ServiceLocation.dll but was not handled in user code"
in the CreateRegion method of the RegionManager class.
To solve this issue I needed to make some changes to Mokosh's solution:
Replace GetModuleEnumerator method in Mokosh's Bootstrapper with the following one:
override IModuleCatalog GetModuleCatalog()
ModuleCatalog catalog =
Page constructor should first execute the bootstrapper, then Initialize the components (this way the
RegionManager can be located)
Bootstrapper bootStrapper =
There are also some things that should be done and the post does not say explicitly:
StartupUri tag should be added in app.xaml. For example:
OnStartup method from App class should be deleted
You should replace Window by Page in Shell class (both in xaml and cs). For example:
<Page ...... and public
Shell : Page
Please let me know if this helps you solve your issue. If not please tell me what changes have you done to make Mokosh's solution run in Prism v2.