unity-containerprismprism-6

Is Prism 6.3.0 tied to an older version of Unity (I can't seem to upgrade)


I've got a WPF App using the latest version of Prism for WPF (6.3.0) and Unity. Just a few modules. It works great.

When I manage NuGet packages for my solution, it tells me that there is a new version of Unity (5.4.0) available. Unfortunately, if I try to update to that version, I can no longer build.

It's pretty clear to see why: Upgrading unity via this method removes all references to it (Unity) from my project. Specifically the following 3 references completely disappear from all my projects without any replacement:

(The Prism references remain, of course)

Error messages tell me that IUnityContainer is defined in an unreferenced assembly (Microsoft.Practices.Unity. 4.0.0.0). Given that it removed those assemblies, this all makes sense.

If I then try to go looking to add Unity back in, the Add Project Reference dialog cannot even find Microsoft.Practices.Unity when I search for it.

Now this isn't that big of a deal. I didn't need to upgrade. and it's easy for me to revert back. But I want to understand why this is failing for future reference.

  1. Does this mean that Prism is tied to the older version of Unity and I just shouldn't upgrade?
  2. Does this mean that types have moved to different namespaces and I need to make some other fix?
  3. Some other reason?

Solution

  • Among the Unity 5 updates included a change of namespaces which as you noticed was a major breaking change. There are no plans for Prism 6 to support Unity 5, however the current Prism 7 previews (which is available for WPF) have updated both the Common Service Locator and Unity. https://www.nuget.org/packages/Prism.Unity/7.0.0.336-pre