PRISM 2.1 Module Loading in PRISM 2.2 based Shell

Topics: Prism v2 - Silverlight 3, Prism v2 - Silverlight 4
Dec 23, 2010 at 4:07 AM

Hi,

I am currently working on problem which is related to different version of PRISM used for Shell and a Module. I created a module which uses PRISM 2.1. I am trying to load this module into a PRISM Shell which uses PRISM 2.2. In my module, I am having constructor which accepts IUnityContainer as parameter.

 

When I tried to load the module, following error message is thrown and module load fails.

"The current type, Microsoft.Practices.Unity.IUnityContainer, is an interface and cannot be constructed. Are you missing a type mapping?"

Any one has faced this problem before?

Regards,

Madhan

Dec 23, 2010 at 6:19 PM

Hi Madhan,

As explained on this blog post from Bob Brumfield, Prism 2.2 targets Unity 2.0, while Prism 2.1 targets Unity 1.2. This might be the cause of the exception you're experiencing.

It is recommended to use the same version of Prism across your application. You might find this documentation useful, which refers to upgrading versions and changes between Prism 2.x versions.

I hope you find this information useful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

 

Dec 24, 2010 at 12:58 AM

Hi Miguel Bronzovic,

I was also on the same conclusion for this error. I noticed that names are different for Unity assembly in PRISM 2.2 and 2.1. So went ahead and renamed the assemblies to be same. I checked on the IUnityContainer and UnityContainer types for change in the definition between Unity 2.0 and Unity 1.2. There were no changes. So I am wondering why it is broken.

I am working on a enterprise LOB application where different applications will be loaded into same shell and applications can be developed in different time frames which will result in different PRISM framework being used.

The URL related to upgrade changes are talking about migrating from PRISM June 2008 to PRISM Feb 2009. I am looking for document which talks about PRISM Oct 2009 to PRISM May 2010.

Regards,

Madhan

Dec 27, 2010 at 2:54 PM

Hi Madhan,

Using different versions of the unity container within the same application is not necessarily supported. You might find better support regarding that in the Unity forums.

As for the documentation to migrate between the versions you're mentioning, you might find the Knowledge Base article referenced in this blog post by Blaine Wastell useful. As this is a minor update in Prism (explained in the downloads section), the migration should be straightforward. Take into account that the recommended approach would be to use the same version of Prism throughout your application.

I hope you find this information useful.

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

Dec 27, 2010 at 3:14 PM

Hi Miguel Bronzovic,

Thanks for the help.

Regards,

Madhan