Is there any Microsoft.Practices.ObjectBuilder2.dll for Silverlight

Dec 8, 2008 at 3:21 PM
Hello All,

Is there any Microsoft.Practices.ObjectBuilder2.dll for Silverlight? I found only Microsoft.Practices.Unity.dll in drop 7. Initially, it was Microsoft.Practices.Unity.Silverlight.dll but the name has been changed for good.

I'm planning to use this code below in Silverlight Module.

container.RegisterType<ICustomerDetails, CustomerDetails>(new ContainerControlledLifetimeManager());

I'm getting the following error at this line above.

Error    1    The type 'Microsoft.Practices.ObjectBuilder2.IRequiresRecovery' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.    C:\Michael Sync\CompositeWPF\V2 Drop 7\Prismv2D7Sample\CALApplication.Shell\CALApplication.Modules.CustomerModule\CustomerModule.cs    32    13    CALApplication.Modules.CustomerModule.Desktop

Any idea??


Dec 8, 2008 at 4:52 PM
The Microsoft.Practices.Unity.Silverlight.dll resides in the LIB\Silverlight\Unity folder - once you add a reference to this you'll be good to go :)
Dec 9, 2008 at 12:25 AM
>>Microsoft.Practices.Unity.Silverlight.dll

There is no dll with that name in Drop 7. But I have double-checked that folder and there is only one dll called Microsoft.Practices.Unity.dll under Source.zip\LIB\Silverlight\Unity.

And  I have added that dll in my project tooo. I'm still getting the error as I'm keeping "ContainerControlledLifetimeManager" in my code.

Am I missing something?
Dec 9, 2008 at 12:54 AM
Nope, I don't see where you are doing anything wrong... I added Microsoft.Practices.Unity (you are correct - there is no .Microsoft.Practices.Unity.Silverlight) to my project and configured a singleton (ContainerControlledLifetimeManager) and received the same results you are - I'm looking into it....
Dec 9, 2008 at 1:08 AM
Looks like a problem with PrismV7 Michael, it's missing the Microsoft.Practices.Unity.Silverlight.dll.  If you'll take the one from PrismV6  (\LIB\Silverlight\Unity) and set a reference to it you'll be okay.   Looks like the Desktop version is sitting in the LIB\Silverlight\Unity folder - it has a dependency on ObjectBuilder2 which resides in the \LIB\Desktop\Unity folder.
Dec 9, 2008 at 3:45 PM
Great! Thanks a lot, Bill