关于 .net:Crystal 报告无法通过 Windows 服务在 Windows Server 2012 上运行,但可以通过 IIS 运行

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

我有一个在 Windows Server 2012 上运行的 Windows 服务,当它尝试生成水晶报告时,我收到此错误:

1
2
3
4
5
6
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'

我还在同一台服务器上的 IIS 中运行了一个 Web 应用程序,它能够在那里运行水晶报告。

相同的代码被部署到其他机器并且工作正常,所以我确定这是一个部署/配置的事情,我只是不确定要检查什么。

我正在使用从此处安装的 Crystal Runtime for Visual Studio。

目前已检查:

  • Crystal 报表运行时 32 位已安装。 IIS 应用程序在 32 位应用程序池中运行。我的 windows 服务 (c# .net) .exe 编译为 32 位,我已通过任务管理器确认它作为 32 位进程运行
  • 我的服务作为本地系统运行
  • 本地系统对 c:\\\\\\\\windows\\\\\\\\temp 文件夹具有完全控制权
  • 我可以在 GAC 中的 c:\\\\\\\\windows\\\\\\\\assembly\\\\\\\\GAC_MSIL\\\\\\\\CrystalDecisions.CrystalReports.Engine 下找到正确的 Crystal Reports 文件

Server 2012 上是否存在阻止进程使用 CrystalReports 的内容?

非常感谢任何有关故障排除的提示!


最终它开始在服务器上工作,没有任何特定的动作。由于我无法控制服务器,我无法确定是什么触发了它开始工作。我的猜测是这只是另一个重启。有一个很小的机会,虽然我被告知它之前已重新启动,但实际上并没有。在 IIS 上,我发现有时 IIS 需要一段时间才能找到 Crystal Runtime:即使安装后也无法立即运行报告。也许它正在发生类似的事情,不管是什么。