When working on a project recently I got an error that complained the assembly's manifest definition did not match the assembly reference. Read on to discover my simple fix.
When I opened up a project the other day and simply tried to compile it I was struck with the following error:
Could not load file or assembly 'Intelligencia.UrlRewriter, Version=184.108.40.206, Culture=neutral, PublicKeyToken=0573f3650687980d' or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. HRESULT: 0x80131040
The assembly in question could be any assembly. It is
I have a central repository of 3rd party libraries on my development computer. Normally I keep them all in a central location so that I don't have to waste time downloading them again when I need them in a new project.
This time I learned a quick lesson in keeping newer versions partioned away from older versions. Part of my original theory was that I could just drop the latest version of an assembly into that libraries folder and the next time I compiled the project it would use the refresh file and automatically update it to use the latest version.
It turns out that this plan didn't work so well for me. The refresh or maybe the web.config had an older version number embedded in it somewhere. So when it tried to refresh it got confused and gave the error above.
The solution was pretty simple. Just delete the assembly and associated files from my projects bin folder and then choose Add Reference to add the latest version back in.
A quick recompile later and I was on my way.