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

14

37

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.

Chibchan answered 25/6, 2013 at 7:40 Comment(2)
I am having the same issue, while integrating Crystal reports in SharePoint 2010. I can't convert application pool to 32 bit otherwise my web part will stop working. I have all the 64 bit dlls including log4net in place(gac) and I am using 64 bit machine. Still getting the same issue, Please help. ThanksUnnamed
Please find the answers here for the above issue reported.Disembowel
S
31

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:
Suggestibility answered 14/2, 2014 at 13:20 Comment(3)
Thanks. The first options actually did it. Having only 1 point made me think that can't possibly be the solution until I checked another site ;) I guess I shouldn't judge someone by their points hahaGemmulation
Thanks Ndimby, this did it. I just changed to the 32 bit version and forgot to do that. As soon as I saw your post, I knew that had to be the issue. Thanks!Bedspring
Conversely, if you've got the 64bit version installed, ensure Enable 32-bit Applications is set to FalseCruller
R
20

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

Rotorua answered 22/7, 2013 at 20:34 Comment(2)
Re-installed latest Service Pack 5 runtime, still no help.Kurus
In my case I don't have it installed, but I just had to copy the log4net.dll to the bin folder the site was running fromJovia
K
9

Ensure version for correct platform (32-bit or 64-bit) is installed. I faced same issue when installed 32-bit run-time on 64-bit machine. Installing correct one, i.e. 64-bit, resolved the issue.

Kurus answered 7/8, 2013 at 10:30 Comment(1)
Yeah, I had the same problem. After installing run-time 64-but to machine. It gets started working.. Those whoever getting the same error please at least try this solution to get work around. it will easily solve out your problem.Heelandtoe
F
2

I faced same issue (VS 2015), but my application is running under 32-bit application pool. So even though machine is 64-bit. I installed 32-bit installation and it works.

Fasano answered 6/4, 2016 at 7:51 Comment(0)
P
1

So in general dll has to be placed in two places:

  1. GAC ( can have 32 and 64 versions of dll's)
  2. your project bin folder

Thus, you just need add reference to log4net.dll. (In your case 32-bit with PublicKeyToken=692fbea5521e1304)

You can achive that by

Princely answered 5/1, 2019 at 0:49 Comment(1)
thanks for the solution . I checked and found on my local I have the log4net.dll but on the dev server I think it is missing and causing the error.Below
D
1

For this specific error, I installed version 20 of Crystal Report and it solved my problem: https://www.tektutorialshub.com/crystal-reports/crystal-reports-download-for-visual-studio/#Service-Pack-16

You can also download the file alone using the following link https://www.nuget.org/api/v2/package/log4net/1.2.10 rename the file to .zip and extract it.

Ding answered 12/6, 2019 at 10:6 Comment(1)
downloading file alone won't work, its public key 1b44e1d426115821 != 692fbea5521e1304Crosley
H
0

I tried all of that things and it doesn't worked for me.

I Just installed SAPCrystalReport in my computer and it's working now.

Hamon answered 14/9, 2017 at 19:25 Comment(0)
I
0

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

This solution worked for me, thanks.

Injustice answered 3/12, 2019 at 6:49 Comment(0)
G
0

If you are building a windows app try to build as x64 instead of Any CPU. It should work fine.

Gwin answered 26/10, 2020 at 15:37 Comment(0)
L
0

I was able to resolve this issue using below steps:

  1. Uninstall Crystal reports using 'Add or Remove Programs' on Windows. enter image description here

  2. Closed all running apps and used this link (https://www.tektutorialshub.com/crystal-reports/how-to-download-and-install-crystal-report-runtime/#hownbspto-download) to download SP 29 DEVELOPER EDITION DOWNLOAD (I was using .net framework 4.7.2, see below Crystal report version recommendation for other versions).

    enter image description here

❗ Please note: To integrate “SAP Crystal Reports, developer version for Microsoft Visual Studio” you must run the Install Executable by right clicking and selecting "Run as Administrator". Installing the MSI will not fully integrate Crystal Reports into VS. MSI files by definition are for runtime distribution only. Do not run the MSI's on your Development PC, where VS is installed, not required.

References - https://blogs.sap.com/2020/10/30/upgrading-a-visual-studio-2008-2019-.net-project-with-the-latest-cr-.net-sdk-packages/

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Lavin answered 9/3, 2022 at 19:18 Comment(0)
A
0

I would say, if you are using 64-bit version of Crystal Reports, just install 32 bit.

That solved my problem.

Antiphrasis answered 11/4, 2022 at 9:27 Comment(0)
T
0

In my case I migrated crystal report in development computer to last version then migrated the cloud server to same version of crystal report but after published the site I received 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.

the solution I commented the line in web.config

<!--<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />-->

then publish the site again this solved my issue

Teston answered 20/12, 2022 at 7:8 Comment(0)
D
0

You need to install crystal Report's RunTime version (version 33 and above) and 4.8 framework. Interestingly, both 32 and 64 versions must be installed on 64-bit Windows. But the issue that exists is that it is installed on server 2016 and above, and on Windows server 2012, I did not try to solve the problem.

Defeasible answered 27/8, 2023 at 7:59 Comment(0)
B
-1

Error (While using Visual Studio 2015 in win 10 64 bit machine):

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.

Solution: 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

The above solution is solved my problem. Thanks.

Bylaw answered 22/8, 2020 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.