Thursday, September 25, 2008

The located assembly's manifest definition with name xxx.dll does not match the assembly reference

A client was getting this error on a set of ASP.NET pages when I sent them a new compiled DLL for the C# code-behind (ASP.NET 1.1), and I wasn't sure what was going on. I then noticed something in the stack trace which clued me in to what they were doing wrong:


Assembly Load Trace: The following information can be helpful to determine why the assembly 'xxxold' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = xxxold
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/xxx
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===


It was the xxxold in there that tipped me off to what they had done wrong. Apparently, as a way to back up the old DLL before putting the new DLL in the ./bin folder, they just renamed the old one xxxold.dll, which causes C# to throw this error. If fact, after I tested it, any DLL that isn't explicitly referenced in the DLL will cause an error if it is placed in the ./bin folder. To fix the problem all I had the client do was rename the DLL xxx.old instead. This worked perfectly.

No comments: