Will there be a Silverlight Unity 2.0 release?

May 27, 2010 at 2:54 PM

I cannot get the Prism assemblies to build using Unity 2.0.  I have been trying for two days.  The problem is that the IUnityContainer.AddNewExtension<TExtension> no longer exists.  There is a generic method that is gone.  And there is no mention of it in any of the Unity 2.0 documentation.  The CodePlex team did document plenty of the changes and deprecation on Unity 2.0, like the merge of ObjectBuilder2 into Unity and the deprecation of the Microsoft.Practices.ObjectBuilder2.BuildFailedException.  But there is no mention of the elimination of the AddNewExtension.  I pulled down the Unity 2.0 source code and confirmed the method is gone.  The Prism test projects use it extensively and they won't build along with the UnityBootstrapperExtension from the Composite.UnityExtensions.Desktop assembly.  I really need a Prism for Unity 2.0.  I have no choice but to keep trying to build it myself and the Unity 2.0 documentation has a hole in it.  What shall I do?

Can the P&P team try the Unity 2.0 build, then release for the rest of us?  It should not take long for the experts to do it.

I have been around this track a few times now.  Here is the deal:

When I change the CAL Desktop projects to use Unity 2.0 I get an error that some members of the IUnityContainer need to be implemented.  So I implement them as NotImplementedException().  This makes the Desktop CAL build.  But then the Silverlight CAL breaks.  Apparently most of the Silverlight CAL files are actually links to Desktop CAL files.  After implementing the Unity 2.0 IUnityContainer Members they do not build in the Silverlight CAL because the Silverlight Unity assembly has no idea about the new IUnityContainer Members.  So, I need a Silverlight Unity 2.0 assembly.  I have no idea if one exists.

Will there be a Silverlight Unity 2.0 release?


May 27, 2010 at 8:07 PM
Edited May 27, 2010 at 8:09 PM

The Silverlight Unity 2.0 release already happened, it's at http://msdn.microsoft.com/en-us/library/ff678312.aspx.

The AddNewExtension<TExtension> is not deprecated. It's just been moved to an extension method. Add:

using Microsoft.Practices.Unity;

to the top of your file and it'll show up. The code is in the UnityContainerExtensions class, along with the zillion other method overloads.

Also, have you seen this post on the Prism site? The team has already released new Prism source that works with Entlib 5 and Unity 2.

May 27, 2010 at 9:33 PM

Thank you.  This is EXACTLY what I have been searching for.  Especially the post on the Prism site for Composite Application Guidance for WPF and Silverlight - May 2010 Release (Prism V2.2). http://compositewpf.codeplex.com/releases/view/46046

Thanks for the quick response.

My observation:  Try searching for Unity 2, Unity for Silverlight, and things like that.  You won't be able to find it on Codeplex.  The main page for Unity has Silverlight Unity 1.2 posted.  I was not able to find Unity 2 for Silverlight until you helped me.  How am I expected to find this page except through your help?  Teach me if I missed the useful search or navigation features.  (It would be a shame for people to work hard and produce a release but not have it well published.)


Oct 12, 2010 at 2:15 AM

JoeKhal, hello and thank you for your feedback. Just a comment on discoverability of Unity 2.0 release.

That must have been just the timing of indexing of content by codeplex. The release in May was still fairly fresh.

I tried the search today and Unity 2.0 is properly discoverable on codeplex.

- Grigori