Microsoft Unity 2.1 for Silverlight 5 ?

Topics: Prism v4 - Silverlight 4
Feb 27, 2013 at 2:29 PM
Does anybody from the p&p team knows, if there will be ever a version of Unity compilied agains SL5?
The library Microsoft.Practices.Unity.Silverlight is still using the mscorlib of 2.0.

If I'm using PRISM and the EntLib Integration Pack I get code analysis problems (VS2010) , because of the different versions of mscorlin (2.0 and 4.0)
The company I'm working for don't allow to deactivate the code analysis.

Feb 27, 2013 at 4:45 PM

Since this subject is more related to Unity, you might find better support about it in the Unity site:

Regarding your question, in the following thread, Randy Levy mentions that a version for Silverlight 5 (non-beta) might be implemented as part of the Unity 3 release (which is still in Preview at the moment):


Federico Martinez
Feb 28, 2013 at 7:47 AM
Hello Federico,
thank you for your answer.
But at least it is also a problem of Prism 4, because it is using an old version of the servicelocator using the mscorlib.dll ( instead of (

Now our company cannot switch from SL4 to SL5, because Prism, EntLib and Unity have something like an 'good' old DLL hell. Code analysis has to be turned off, which isn'e allowed in our company ;-(

Feb 28, 2013 at 9:08 PM
Hi Dirk,

As you mentioned, Prism uses a version of the ServiceLocator which targets the mscorlib.dll version. Based on my understanding, this is because when Prism 4.1 was released, that was the latest version of the ServiceLocator library available.

I have checked the ServiceLocator's CodePlex site and it seems that a newer version is available in the from of a Portable Class Library which targets Silverlight 4 and higher (so I suppose it is using the version of the mscorlib.dll .) You can find it in their downloads page:
As a quick workaround, you can try updating Prism's source code to reference this new version of the ServiceLocator and recompile the library.
Also, you can create a issue in the Issue Tracker section requesting to update the Prism library to the latest version of the ServiceLocator , so that it could be take into account by the p&p team for a future release.


Damian Cherubini
Mar 5, 2013 at 8:14 PM
Hi Damian,

thank you for your answer.
I've recompiled the ServiceLocator, Unity, Prism and the EntLib Integration Pack for Silverlight after changing the target to mscorlib.dll 4.0.
Everything seems to work correctly and I'm getting no getting no CA errors anymore.
Maybe I'll write a blog entry about that updating of the libraries.