序
call crystal report 時報 cannot load file log4net
Error Details
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at CrystalDecisions.Shared.SharedUtils..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()
at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
at CrystalDecisions.CrystalReports.Engine.CREngineRes.GetString(String name)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
--- End of inner exception stack trace ---
Scope
64bit .net 4.7 program
build in anyCPU
要generate report as pdf
那特別在 windows client 時沒有報錯
windows client 安裝 SP27 64bit runtime 便能跑
windows server 安裝 SP27 64bit runtime 後一直報錯
Try and Error
在windows server試了一大輪,
安裝 SP27 64 bit runtime 不行,一直報錯
都刪除,安裝 SP29 不行
都刪除,安裝 SP37 不行
都刪除,安裝了 SP37 32bit runtime
便沒有報錯,可以跑了
Solution 解決方法
海豚也不明白,怕32bit runtime少了什麼,因為一直都是用64bit runtime
所以連64bit 都安裝在win server上算了
Reference
log4net.dll and other errors like CrystalDecisions.ReportAppServer.*
Downloads for SAP Crystal Reports, SAP Crystal Presentation Design and SAP Crystal Dashboard Design
https://origin.softwaredownloads.sap.com/public/site/index.html
No comments:
Post a Comment