Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly log4net or one of its dependencies

Tags:

c#

asp.net

I've been asked to take a look at an error in an ASP/C# application with its Paypal integration. The error, shown in full, is:

Could not load file or assembly 'log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=b32731d11ce58905' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

From what I understand, this means that the actual file located (that is, log4net.dll in my bin directory) does not match the version expected based on some assembly configuration. The problem I'm having is that I cannot locate where this file is being referenced.

I have access to all the files in the web root directory of the site, and cannot locate any config files that reference this DLL. Where else might I need to look to determine what's causing the mis-match?

As a note, I've made sure that the version of the DLL in the bin directory is up to date, but this does not seem to have resolved anything.

like image 253
Elie Avatar asked Jan 10 '11 00:01

Elie


1 Answers

We had this problem also when we moved to VS 2010 and .NET 4.0, we don't use log4net at all, but I suspect something else we use does (maybe Crystal Reports?) and I also suspect there is a dll we use that is a 32-bit dll as well because when I change the "Enable 32-Bit Applications" option under the advanced settings for the Application Pool in IIS to "True" everything worked again.

like image 165
Matt Palmerlee Avatar answered Sep 21 '22 17:09

Matt Palmerlee