I'm porting code toVS2010/Crystal Reports VS2010 that has worked flawlessly 24/7 for the past 2 years. Original code used VS2008/CR VS2008.
I generate reports from a background Windows service using Crystal Reports. I have a set of report generation CR components that work in a variety of contexts - WinForms apps, console apps and the Windows service.
When I ported to VS 2010, all of my apps worked fine, except for the Windows service. In the service, the first call to Table.SetDataSource() causes the service to crash. I've used detailed logging in the service to pinpoint the source of the error. I log before and after the call to SetDataSource(), but only the before message is logged.
VS2010 version - 10/0/30318.1 RTMRel
CR VS2010 runtime version - 13.0.2000.0
I see the following in the 'Application' event log after this happens:
=======================
EventType clr20r3, P1 usastudiosservice.exe, P2 1.0.4065.17651, P3 4d5d3537, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 2463, P8 0, P9 system.io.fileloadexception, P10 NIL.
=======================
Application: UsaStudiosService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
Stack:
at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
at System.Reflection.Assembly.LoadFrom(System.String)
at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr)
======================
I'm catching all exceptions in my report generator component, but, for some reason, this exception isn't caught. I think it's because it's occurring in the CLR and the CLR is aborting the process.
I've been monitoring the service in ProcMon. I see a final set of references to the CrystalDecisions.ReportAppServer.DataSetConversion assembly that succeed, 3 attempts to access the assemby's PDB file that fail, and then DW20.EXE (C:\Program Files\Common Files\Microsoft Shared\DW\DW20.EXE) is loaded to process process the error. (Could the missing PDB file be the problem?)
The ProcMon trace looks entirely different when I run the report gen components from the WinForms and console apps.
I don't think this is a permissions issue. I've been able to log in as the user that the service logs in as and have been able to run both WinForms and console versions of the report generator without problems.
Any help would be greatly appreciated. I absolutely have to convert this app!
-David