Crystal Reports error when deployed..Could not load file or assembly 'log4net

Solution 1:

I received the same error message after accidently installing the x86 version of the crystal reports redist on a x64 machine.

Installing the correct x64 redist fixed the problem - http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0.zip

Solution 2:

We just ran into the same problem and it turned out to not (in our case) be the version of the Crystal Reports redist (we installed the 32 bit versions on our 64 bit machines. The way we were able to fix the problem was to

Navigate to your virtual directory Application Pool -> Advanced Settings -> Set Enable 32-Bit Applications to True

and changed the managed pipeline mode from Classic to Integrated. After that we no longer got errors of the missing log4net dll.

Solution 3:

We also had the same issue with the 64-bit redistributable installed. In our case, we set the "Enable 32 Bit Applications" setting to FALSE in the advanced Application Pool properties and that resolved the issue.

Solution 4:

If you have a x86 development machine and your web server is a 64-bit machine, you may be running into the problem discussed here:

http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/546059a6-7179-4027-8f16-822ac6dc189a/

Visual Studio is automatically deploying a 32-bit log4net.dll into the 64-bit web server, even if you don't have it referenced in your project. Just delete the log4net.dll from your bin directory once deployment has finished because it's not actually required by the CR runtime to work.