9

Forgive me if it has been answered before but I searched the web and found only desperate people asking exactly my question but nobody giving any answer which I could use.

I'm developing an application in C# Visual Studio 2010 which uses Crystal Reports. I'm developing it on 32 bit system. Everything works okay.

Now I'm trying to run it on another computer which is 64 bit system has Crystal Reports installed and some terrible error happens.

************** Tekst wyjątku **************
System.TypeInitializationException: Inicjator typów zgłosił wyjątek dla typu
 'CrystalDecisions.ReportSource.ReportSourceFactory'. ---> System.TypeInitializationException:
 Inicjator typów zgłosił wyjątek dla typu 'CrystalDecisions.Shared.SharedUtils'. --->
 System.IO.FileLoadException: Nie można załadować pliku lub zestawu 

'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' lub jednej z jego zależności.

Forgive me some Polish language there. It basically means that it cannot find some specific version of log4net.dll file which apparently must be used by something.

This problem was described in many places:

log4net not logging and throwing error

http://scn.sap.com/thread/1857957

I understand that my application uses/expects some version of this file and Crystal Reports installed on 64 bit machine uses another version.

Still after browsing the internet I have no idea what steps I should take to correct it.

I would be really grateful for some "tutorial for dummies" how to deal with it.

Oh, and my application needs to be built as 32 bit and run on 64 bit. No possibility of building it as 64 bit, another thing would stop working :(

Community
  • 1
  • 1
RRM
  • 3,371
  • 7
  • 25
  • 40
  • What is the version of log4net that you are using and delivering with your application? – Daniel Hilgarth May 27 '13 at 15:55
  • How can I check it? I didn't add it myself, it isn't present in any directory of my application. I just learnt about its existence from the error. It's Crystal Reports which takes it from somewhere. – RRM May 28 '13 at 07:51
  • It sounds like the 64-bit computer just had the 64-bit version of Crystal Reports, and you should just install the 32-bit version as well, since your application requires that. You can see the Processor Architecture in the GAC that the log4net 1.2.10.0 probably only had one entry, as AMD64 which is the 64-bit version, and once you install the 32-bit Crystal Reports, there should be a x86 entry for the log4net assembly. – Zack Mar 05 '15 at 22:04

5 Answers5

16

Installing CR 32 bit (CRRuntime_32bit_13_0_14.msi) will resolve the error.

The 32 and 64 bit versions can be found here.

GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104
Jasmine John
  • 161
  • 1
  • 2
7

Well, not much response here :) I've learnt a few things myself since then and have thought I would share my knowledge with any poor beginner people that may encounter the similar problem.

So there is something like GAC - http://en.wikipedia.org/wiki/Global_Assembly_Cache You may think of it as a collection of libraries and drivers used by your programs.

It is on your computer in c:/windows/assembly but it is a hidden directory so first you must enable seeing it.

At my 64 bit computer it contained GAC_32 and GAC_64 subdirectories. In GAC_64 there was log4net in:

c:\Windows\assembly\GAC_64\log4net\1.2.10.0__692fbea5521e1304\

In GAC_32 there was nothing. So I created the directory and copied the appropriate file from my 32 computer into it and it worked.

c:\Windows\assembly\GAC_32\log4net\1.2.10.0__692fbea5521e1304\

Still a moment later I faced another error but it is a different story

CrystalDecisions.CrystalReports.Engine.ReportDocument'. ---> System.IO.FileNotFoundException: Nie można załadować pliku lub zestawu 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

Generally expect that anything using Crystal Reports build on 32 bit computer may give problems when tried to run at 64 bit computer. SAP did really a crappy job with these drivers.

RRM
  • 3,371
  • 7
  • 25
  • 40
6

Do you have SAP Crystal Reports runtime engine for .NET framework (64-bit) installed on the target machine? If not, you may try installing it from this link and see if it will fix your problem.

GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104
Kinyanjui Kamau
  • 1,890
  • 10
  • 55
  • 95
  • Yes I have it on my local machine and works, but I dont think I should install it on the server or should I? On the server I have installed the build from SP 06 https://www.crystalreports.com/download/ – luis_laurent Mar 13 '21 at 00:45
1

Also, if you have installed only the 32bits version on a 64 bits platform, you'll get the same Log4net error; both version, 32 & 64 bits, are required.

It's curious that 64bits msi delploys DLL in SAP 32bits folder (C:\Program Files (x86)\BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\ ) that 32bits setup doesn't.

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Dude76
  • 11
  • 2
-1

In my case, installing CR 64-bit wasn't an option, but I was able to work around this issue by enabling 32-bit application on the App Pool in IIS. (See this answer).

Jay
  • 829
  • 6
  • 17