Feed

Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0

by pazcal 23. August 2011 11:52

Ever had this annoying problem?

When you try to load a website, you get in the browser the nice message:

”Additional information: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)”. When we we’re checking the Microsoft.Practice.Unity.dll Version, we are using the Version=2.0.414.0.

First we’ve cleaned up the whole project and try to build it. Building succeeded… So lets try again to approach the website with the browser. Still the same error. So, set the .dll file “Specific Version = false” in the properties window of Visual Studio. We thought this problem would be fixed, but it didn’t. Even while we are using a specific library folder, with only this specific.dll file, it #fails! to load the correct assembly.

Last change, lets clean up the whole bin folder, by deleting all the files, and recompile again. Again, no result.

After a time of struggle, we find out that we had also Enterprise Library 5.0 installed on the machine. At some strange way, EntLib 5.0 is messing up the references of the libraries and throws the Microsoft.Practice.Unity.dll from the GAC instead of the library folder.

After de-installing EntLib 5.0 software from the local machine (by de-installing, I mean ‘Add and Remove programs’), recompiling the code, and approach the website again by browser, everything works as it should be…

Add comment




biuquote
  • Comment
  • Preview
Loading



About the author

Hi. This picture next to this line is me, a.k.a. Pascal de Jonge. I'm currently working as a software engineer @ Tellus, Rotterdam, The Netherlands. Keywords for my work are .NET, C#, WPF, Silverlight, jQuery, CSS and some other random shizzle...

On my own free time, I'm running a small Webdesign/Development Company and playing a lot of games. Reason for this blog is for me to publish several projects like jQuery plugins, Silverlight Apps or WinPhone7 Apps...

Feel free to contact me or just to say 'hi' in several ways, like Twitter, the old fashion contactform or pascal[at]pazquality[.]com.

Widget Twitter not found.

Root element is missing.X

Mostly compatible with

Plugins compatibility

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.