Search code examples
.netcrystal-reportswindows-server-2012crystal-reports-2010

Crystal reports not working on Windows Server 2012 from windows service but working from IIS


I have a windows service running on Windows Server 2012 and when it tries to generate a crystal report I get this error:

System.IO.FileNotFoundException: Could not load file or assembly 
    'CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral,
    PublicKeyToken=692fbea5521e1304' or one of its dependencies. 
    The system cannot find the file specified.
File name: 'CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, 
    Culture=neutral, PublicKeyToken=692fbea5521e1304'

I also have a web app running in IIS on the same server and it's able to run crystal reports there just fine.

The same code is deployed to other machines and works just fine, so I'm sure it's a deployment/configuration thing, I'm just not sure what to check.

I'm using the Crystal Runtime for Visual Studio, installed from here.

Checked so far:

  • Crystal reports runtime 32-bit is installed. IIS apps are running in 32-bit application pool. My windows service (c# .net) .exe is compiled for 32-bit and I've confirmed via Task Manager that it's running as a 32-bit process
  • My service is running as LOCAL SYSTEM
  • LOCAL SYSTEM has full control to c:\windows\temp folder
  • I can find the right Crystal Reports files in the GAC, beneath c:\windows\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine

Is there something on Server 2012 that could be preventing the process from using CrystalReports?

Any tips on troubleshooting greatly appreciated!


Solution

  • Ultimately it started working on the server, without any specific action. As I don't have control over the server I can't be sure what triggered it to start working. My guess is it was just another restart. There's a small chance while I was told it was restarted previously it actually wasn't. On IIS I've found that it sometimes just takes a while before IIS can find Crystal Runtime: even after installing it isn't able to run reports instantly. Perhaps it's a similar thing going on, whatever that is.