Search code examples
c#.netwpfdllbuild-process

How to build Prism4.5 for WPF


I am trying to build Prism in .net 4.5. There's a conflict with assembly versions of Unity 3.0 and Unity Extensions.

I have Disassembled a WPF (Prism).dll file (Microsoft.Practices.Prism.UnityExtensions.dll) using ILDASM, there I got 3 files with extensions like .IL, .res and .g.resources. I have changed the version number of a referenced file in metadata of the .IL file and assembled the file into .dll.

After using the new (Microsoft.Practices.Prism.UnityExtensions.dll) with updated (3.0.0.0 instead of 3.0.1208.0) version number of referenced Microsoft.Practices.Prism.Unity.dll, I am getting below exception.

Could not load file or assembly 'Microsoft.Practices.Prism.UnityExtensions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

I have signed the new dll but with an untrusted certificate.


Solution

  • I've done this as we updated to using .NET 4.5 with Unity 3 and Prism. You need to re-sign UnityExtensions in order to use Unity 3.0.XXX.X

    Here is a few easy steps that will get you through:

    http://compositewpf.codeplex.com/discussions/443219