Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'

I'm using vs2010 and crystal report version 13.0.2000.0 ,system 64bit crystal report runtime 64bit. my application is running fine on development machine but when i'm deploying on server getting this error

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

Source of error:

CR:CrystalReportViewer ID="CrystalRportViewrRegistration" runat="server" AutoDataBind="true"

and I have checked GAC assembly I didn't find log4net.dll and even in my system I have search all and tried various things like changing runtime version and uploading lo4net dll from apache but no luck.

like image 784
Kulmi Rajmal Avatar asked Jun 25 '13 07:06

Kulmi Rajmal


People also ask

Could not load file or assembly Log4net or one of its dependencies?

Solution 1 Just remove it from the dll from your project and then try to build the project. Since you don't need that one. In case you want to include that dll, you should check that, the application pool you are using is compatible with the assembly.

Could not load the file or assembly or one of its dependencies?

There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.

What is Log4net dll?

dll in Solution. Log4net is an open-source project based on the work of many authors. It allows the developer to control what log statements are output with arbitrary granularity. It is fully configurable at runtime using external configuration files.


2 Answers

To configure IIS to run 32-bit applications you must follow these steps:

Open IIS Go to current server – > Application Pools Select the application pool your 32-bit application will run under Click Advanced setting or Application Pool Default Set Enable 32-bit Applications to True 

If this option is not available to you, follow these next steps:

Go to %windir%\system32\inetsrv\ Execute the appcmd.exe tool: 
like image 158
Ndimby Avatar answered Sep 30 '22 11:09

Ndimby


If you don't see log4net.dll in %systemdrive%\windows\assembly\ on the machine you are attempting to deploy it on, it is likely you haven't successfully installed the redistributable for Crystal Reports for .Net Framework 4.0

Install (or reinstall) the latest service pack from http://scn.sap.com/docs/DOC-7824 (SAP Crystal Reports, developer version for Microsoft Visual Studio Updates & Runtime Downloads)

That runtime distribution should add log4net to the GAC along with a bunch of CrystalDecisions dll's

like image 28
arserbin3 Avatar answered Sep 30 '22 12:09

arserbin3