Composite Application Guidance for WPF with EntLib 4.1

Tuesday, November 18, 2008 – 5:16 PM

pnp-logo I’ve been working on an application that uses Composite Application Guidance for WPF (Prism) and wanted to upgrade to use Enterprise Library 4.1 rather than the 4.0 version that Prism originally shipped against.

Turns out updating this is pretty straightforward (but not trivial)…

  1. Install Enterprise Library 4.1 – October 2008.
  2. Copy the new versions of the binaries from the EntLib install Bin folder into the appropriate Source\Lib\EntLib and \Source\Lib\Unity folders.
  3. Open the Source\CAL\CompositeApplicationLibrary.sln solution.

If you’re optimistic like me at this point you probably hit F5 in the hope everything would just work. Of course if that were the case then I wouldn’t be writing this blog post…

What you see is build errors. The more observant will notice that the IUnityContainer interface has changed causing lots of compile errors as the MockUnityContainer class doesn’t implement the interface fully.

Luckily a replacement class is already available as the Prism team are now developing version 2 against EntLib 4.1 so have already encountered this issue…

  1. Download the Prism V2 Source Code and install it.
  2. Copy the MockUnityContainer.cs file from the V2 CAL\Desktop\Composite.UnityExtensions.Tests\Mocks\ to Source\CAL\Composite.UnityExtensions.Tests\Mocks\ in the V1 install folder.
  3. Rebuild the solution and rerun all the unit tests.

Everything should pass. You now have a set of binaries for use against EntLib 4.1.

  1. 1 Trackback(s)

  2. Nov 29, 2008: Notes From the Team Room : Prism And Custom Enterprise Library Listeners

Sorry, comments for this entry are closed at this time.