Crystal Reports: is it useful to compile my project using the log4net.dll version of Crystal Reports?

I am using Apache's log4net version for logging

1.2.10.0 (with PublicTokenKey=1b44e1d426115821) 

But unfortunately, SAP Crystal Reports uses its own version of this library with a different token public key (compiled with its own snk file):

 1.2.10.0 (with PublicTokenKey=692fbea5521e1304) 

Same version, different public token key. When I compile my solution, I have a message telling me the following:

"Cannot resolve the conflict between" log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 1b44e1d426115821 "and" log4net, Version = 1.2.10.0, Culture = neutral, PublicKeyToken = 692fbea5521e1304. Selecting "log4net, Version = 1.2.10.0.0 , Culture = neutral, PublicKeyToken = 1b44e1d426115821 "arbitrary".

The worst part is that I cannot deploy to a 64-bit machine without installing the 32-bit version of Crystal Reports (which installs the log4net assembly on the GAC)

I took the log4net protocol version from the GAC, and the question is:

Will I allow anything if I start using the Crystal Reports version (PublicTokenKey = 692fbea5521e1304)?

and What if I want to use the next version of log4net (say v1.2.11.0)?

Is there any way to solve this correctly?

+7
source share
2 answers

Well, since log4net is open source, you can just compile it under a different name.

I'm not quite sure if this will work, but I suspect that you can also look into aliases . See also here .

0
source

you add this code to App.config:

 <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.2000.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.Enterprise.Framework" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="CrystalDecisions.Enterprise.InfoStore" publicKeyToken="692fbea5521e1304"/> <bindingRedirect oldVersion="14.0.2000.0" newVersion="12.0.1100.0"/> </dependentAssembly> </assemblyBinding> </runtime> 
0
source

All Articles