When you can’t seem to fix “The located assembly’s manifest definition does not match the assembly reference”September 5, 2009 2 Comments
I’ve dealt with this one a few times. You get the .net error:
Could not load file or assembly ‘MyAssembly, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.
So immediately you start moving DLL’s around, trying to find the one that’s out of date. Usually this means you compiled referencing a newer version of some assembly, and neglected to get that new DLL to your website’s bin folder. But then after pouring over that folder, you find the error is not gone – why can this be! Much hair pulled out…
Then it dawns on me, and I’ve done this one before. Often times I push serializable objects into the session. And so, when the wrong DLL was in there, an old version of object X got pushed into the session. Now that the correct DLL’s are in place, when .net tries to deserialize the object, the versions don’t line up. All I have to do now is close out my browser and reopen the site. Log in again and we’re back in business. Don’t you hate it when something so simple wastes so much time?! Hopefully in the future I will remember this blog post.* News, .NET Programming