Enhancing the Prism Module Initialization Lifecycle

Topics: Prism v4 - WPF 4
May 24, 2011 at 6:27 PM

I was trying to attached my application to enhanced an approach for module initialization within Prism-based applications.

I am using the following URL as a sample http://www.aspiringcraftsman.com/2009/05/24/enhancing-prism-module-initialization/

Here is my repo project:  https://cid-8017f79e49592b4d.office.live.com/browse.aspx/prismExample?nl=1&uc=1

I am getting the following eception when the application initializes :  ResolutionfailException

Resolution of the dependency failed, type = "Microsoft.Practices.ServiceLocation.IServiceLocator", name = "(none)".Exception occurred while: while resolving.Exception is: InvalidOperationException - The current type, Microsoft.Practices.ServiceLocation.IServiceLocator, is an interface and cannot be constructed. Are you missing a type mapping?-----------------------------------------------At the time of the exception, the container was:
  Resolving Microsoft.Practices.ServiceLocation.IServiceLocator,(none)

I can't figure out what I did wrong. Can someone give me a hand with this problem?  

I am doing this project because I want to update splash screen with information to user about module loading information.

Thanks in advance.

Regards,

John

Developer
May 24, 2011 at 8:34 PM

Hi John,

We tried to download the sample you've provided, but we got the following message in SkyDrive: "This item might have been deleted, expired, or you might not have permission to view it(...)". Please provide us with a new link for us to download the sample, so that we can help you troubleshoot your scenario.

Thanks,

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

May 24, 2011 at 8:43 PM

Hi Guido,

Please retry the URL(https://cid-8017f79e49592b4d.office.live.com/browse.aspx/prismExample?nl=1&uc=1).  I fixed the folderpermissions to include everyone now.  Talk to you soon.

Regards,

John

 

May 24, 2011 at 10:08 PM

Hi Guido,

Did you download the repo sample?  Talk to you soon.

Regards,

John

May 25, 2011 at 10:12 PM

Hi Guys, Guido,

Did anybody have take a look at the issue I reported with my sample repo program?

Regards,

John

Developer
May 26, 2011 at 2:39 PM
Edited May 26, 2011 at 2:40 PM

Hi John,

The error you're experiencing seems to be caused by the fact that, in your override of the ConfigureContainer method in your bootstrapper, you haven't called the base implementation, which among other things, registers the interface mapping for the IServiceLocator interface.

If you change the code in your ConfigureContainer method to this:

 

protected override void ConfigureContainer()
        {
            base.ConfigureContainer();
            _moduleInitializationService = new ModuleInitializationService();
            Container.RegisterInstance(_moduleInitializationService, new ContainerControlledLifetimeManager());
        }

 

The aforementioned exception isn't thrown anymore.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

May 26, 2011 at 3:16 PM

Hi Guido,

Thanks a million.  

Regards,

John

May 26, 2011 at 3:23 PM

hello dotcomputercraft

can you keep this post up to date with your findings ?

im really interested on how you will be able to update the splashscreen

 

Thanks

May 26, 2011 at 3:49 PM

Sure...  I post my final repo sample once I complete.  It should be in a few days.  I have to catch up on some work.

Regards, 

John

Jun 16, 2011 at 8:58 AM

hello dotcomputercraft

 

anything news about this subject ?

 

Regards

Jun 17, 2011 at 8:22 PM

hi mkadoussi,

I have not updated the project yet because I was assigned a very large project that I am currently working on.  I will post my final findings on this subject soon.

Regards,

John