0

My console app use crystal Report .rpt to generate report.I have referenced dll(CrystalDecisions.CrystalReports.Engine) required for SAP Crystal. When i run that console it run perfectly and generates report.

Now. I have a SQL Server agent job that run the(CmdExec) .exe of that console app. When i run the job it gives me error(Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0). Please advice me on this, I have spent lots of time to fix this issue

Sudip Thapa
  • 33
  • 1
  • 7
  • Is your Crystal engine 32-bit, and perhaps your SQL engine 64-bit? – David W Aug 26 '15 at 17:21
  • Yes exactly David :). Actually Sql is on different server(64 bit) and that console appplication on different server(App server). So how to fix this isssue. – Sudip Thapa Aug 26 '15 at 17:24
  • Ugh. A 64-bit SQL Server cannot load a 32-bit DLL. There's no workaround I know of, unfortunately. That's just a fundamental reality of 64-bit and 32-bit executables; 64-bit executables cannot load 32-bit libraries. – David W Aug 26 '15 at 17:34
  • Could this answer help - http://stackoverflow.com/questions/5812598/how-to-start-a-32-bit-process-in-c-sharp-without-using-shell-execute-on-64-bit-m – Johnv2020 Aug 26 '15 at 17:39
  • 64-bit SQL Server can't have anything to do with the error, if you're doing a CmdExec - this starts a new process. I can think of 2 reasons: (1) if you're running the exe from a share, it could be security related; (2) the application is trying to start as 64-bit because you haven't compiled it for x86 target platform. – Damir Arh Aug 26 '15 at 17:47
  • If CmdExec is starting a 64-bit process that, in turn, is trying to load a 32-bit DLL or assembly, the same problem applies. – David W Aug 26 '15 at 17:59
  • When i build solution(lets forget about CmdExec) uisng Target Platform as 32 bit then console application works fine. If i choose 64bit then i have issue saying TypeExceptio.... error. – Sudip Thapa Aug 26 '15 at 18:07

0 Answers0