cancel
Showing results for 
Search instead for 
Did you mean: 

CR VS2010 could not load crpe32.dll

Former Member
0 Kudos

Background Information:

Crystal Reports for Visual Studio 2010

.net 4.0

Windows XP

I recently upgraded to Crystal Reports for Visual Studio 2010 and I am getting an error that never occurred before. When I try to load a report within a .net 4.0 application I get this error:

Could not load C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crpe32.dll

Stack Trace:

at CrystalDecisions.CrystalReports.Engine.CRPE.CloseCrpe()

at CrystalDecisions.CrystalReports.Engine.ReportDocument.InternalClose(Boolean bSetupForNextReport)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Close()

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)

crpe32.dll is in the location specified in the error.

I've tried targeting earlier versions of the .net framework, uninstalling and reinstalling Crystal Reports (multiple times), and adding useLegacyV2RuntimeActivationPolicy="true" to app.config. Nothing has worked so far.

The report I'm trying to load does not seem to matter; reports created with the old version of CR and reports created with the new version of CR both result in the same error.

Has anyone seen this error before or know how I might fix it?

Brian

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

A new one on me...

Ensure that you are not referencing the 4.0 client framework. You should be using the full 4.0 framework.

Ludek

Former Member
0 Kudos

I am referencing the full .net 4.0 framework.

0 Kudos

Hello,

New one for me also. Search your whole PC for all copies of crpe32.dll. You should only have the one in our x86 folder.

Thank you

Don

Former Member
0 Kudos

I did a search for crpe32.dll. There was only one copy, and it was in the correct location.

0 Kudos

Hi Brian,

Good to confirm.... Do you have another PC where it does work? If so then Process Monitor can be used to compare, if not then you can still look at the log and search for access denied errors. It may be a permission issue or possibly a dependency problem.

Is this a runtime deployment issue or is this happening on your DEV PC?

What happens if you create a new simple project?

Also, what .NET DEV language are you using?

Thanks again

Don

0 Kudos

Another question and confirmation, is your Windows XP a 32 bit OS? And did you set your project to run under 32 bit only?

If it is a 64 bit OS and when you installed CR for VS 2010 did you also check on the option to install the 64 bit runtime? I assume not because you should also have a folder and crpe32.dll in this folder:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64

Thanks again

Don

Former Member
0 Kudos

Thanks for all the replies!

Do you have another PC where it does work?

I do not have another PC where this works. The other developer that upgraded to the new version of Crystal Reports got the same error.

Is this a runtime deployment issue or is this happening on your DEV PC?

This is happening on a dev PC. I have not attempted to deploy the application with the new CR yet.

What happens if you create a new simple project?

I created a new project that did nothing but load a report and called it directly from Main in my application. That was successful. Then I called the code from new project from the location where it is normally called in the software. That resulted in the original error.

Also, what .NET DEV language are you using?

C#

Another question and confirmation, is your Windows XP a 32 bit OS? And did you set your project to run under 32 bit only?

It is a 32 bit OS and the project is set to run under 32 bit only.

former_member208657
Active Contributor
0 Kudos

It sounds like it is project related then. Go through all your project files looking for old references to other Crystal files. I don't know what version you upgraded from but you'll want to look for:

12.0.2000.0

11.5.3700

11.0

10.5

10.2

Also, look at Process Explorer when your application runs. Watch for mixed runtime files and it may point you in the right direction.

Former Member
0 Kudos

Any update on this? I've run into the same problem with a user on a 32 bit Windows 7 machine. It worked fine on the user's previous XP machine, but since switching to Windows 7, this error has showed up.

Former Member
0 Kudos

I figured out what is causing the error, but not why it causes the error or how to fix it. If I create a new project that contains only these lines:

ReportDocument reportDoc = new ReportDocument();

reportDoc.Load(@"C:\Temp\SampleReport.rpt");

The report loads without error. If I change it to look like this:

ESRI.ArcGIS.esriSystem.IXMLSerializer serializer = null;

serializer = new ESRI.ArcGIS.esriSystem.XMLSerializerClass();

ReportDocument reportDoc = new ReportDocument();

reportDoc.Load(@"C:\Temp\SampleReport.rpt");

I get the "could not load crpe32.dll" error. In the real application, whether or not the error occurs depends on if an XMLSerializerClass has been created previously, just like in this example.

0 Kudos

Hi Brian,

Very interesting. It's been a while now but ESRI was or still is an OEM Partner of ours.... I'm wondering if they have hard coded crpe32.dll into their software somewhere and it's ESRI that is actually popping up the error and not CR Assemblies.

What ESRI software do you have installed?

Now that you have a simplified test app can you run Process Monitor as Dave suggested and see what it shows? Or first run [Modules |https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip]with and with the ESRI reference and then compare the 2 lists.

Thanks again

Don

former_member208657
Active Contributor
0 Kudos

Interesting comments by Don there about ESRI. If they are or were an OEM partner then it is possible they are loading crpe32.dll. I'd like you to try a different test. Remove your ReportDocument code and only use the ESRI assemblies. Then use [Process Explorer|http://technet.microsoft.com/en-us/sysinternals/bb896653] to see what your application has loaded while running.

If you see crpe32.dll in the list then you know that ESRI has this loaded somehow in their assemblies.

New Code

ESRI.ArcGIS.esriSystem.IXMLSerializer serializer = null;
serializer = new ESRI.ArcGIS.esriSystem.XMLSerializerClass();

Former Member
0 Kudos

Here is a list of modules that are loaded right before the error occurs in my sample project that are not loaded right before a successful attempt to load a report:

ICUDT22L.DLL

ICUUC22.DLL

XERCES-C_2_7.DLL

XMLSUPPORT.DLL

All four are in C:\Program Files\ArcGIS\bin. In both cases, CRPE32.dll is not loaded at this point.

I am using ArcMap 9.3.1. My application uses ArcObjects, but does not run inside ArcMap.

former_member208657
Active Contributor
0 Kudos

It is likely the xerces-c_2_7.dll that is causing the problems. We have a copy of this in our win32_x86 directory. I wonder why ArcMap has created a local copy of that file in their directory.

Can you tell us everything you can about the xerces-c_2_7.dll file?

- File version

- File size

- Date Created

Make a back up copy of the file, then

- try to delete it: retest

- try replacing with the copy from the BusinessObjects directory: retest

Former Member
0 Kudos

C:\Program Files\ArcGIS\Bin\xerces-c_2_7.dll

Version: 2.7.0

Size: 1687552 B

Modification Date: 5/19/08 18:36:26

I renamed xerces-c_2_7.dll to xerces-c_2_7.dll.bak, and then ran my sample project. I got this error:

This application has failed to start because xerces-c_2_7.dll was not found. Re-installing the application may fix this problem.

Then I copied the xerces-c_2_7.dll from C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86 to C:\Program Files\ArcGIS\Bin and ran the sample project again. I got a different error:

The procedure entry point ?attributeDecl@DefaultHandler@xercesc_2_7@@UAEXQBG0000@Z could not be located in the dynamic link library xerces-c_2_7.dll

0 Kudos

Hi Brian,

Can you check your PATH statement to see if C:\Program Files\ArcGIS\Bin is in there?

Do you know what software you installed created that folder?

If you have a test machine can you install CR first and then install ESRI software and see if they both work?

Is the ESRI software running as a Service? It may be sitting in memory so renaming won't help.

Thank you

Don

Former Member
0 Kudos

From ESRI Support:

"As you told me that you are using ArcGIS 9.3, I would like to inform you that Visual Studio 2010 is not supported with it. You should either use Visual studio 2005 or Visual Studio 2008."

"Unfortunately, Crystal Reports are no longer supported starting at ArcGIS Desktop 10."

It looks like we will have to revert to Visual Studio 2008/Crystal Reports 12.

Thank you for all the helpful responses.

Brian

0 Kudos

Hi Brian,

Thank you for posting the solution. Please mark it as answered.

Have a great day

Don

Former Member
0 Kudos

Hi Brian, What version of ESRI were you using? We are having the same issue in 9.3 SP1 and was wondering if you are on 10?

Thanks, Greg

Answers (2)

Answers (2)

Former Member
0 Kudos

The error message you have got because you are trying to run a corrupted or missing dll file. Windows displays the above message when system unable to run xerces-c_2_7.dll file.

To fix the issue, you can restore it. Here is the link to download xerces-c_2_7.dll file.

http://dllcentral.com/xerces-c_2_7.dll/2.7/

After download the file, restore it to your System32 folder.

That should fix the issue.

former_member208657
Active Contributor
0 Kudos

It looks like the engine called Close internally shortly after you loaded the report. I'm wondering if there is a problem with the report definition that is causing the error to occur. A couple of things to check out.

Process Explorer

1. Use Process Explorer to check out all the files loaded by your process. Have a look at all the one for Crystal Reports. Since you are using Crystal Reports for Visual Studio 2010 they should all be 13.0.0.99. There may be a few at version 1.x, but they are okay.

CR .NET Logging

2. You could turn on some of our internal logging to see if anything shows up there. We control logging through registry keys which I've attached to this reply. You'll need to merge crpe logging ON 13.reg into your registry to turn on the logging, and crpe logging OFF 13.reg to turn it off.

Make sure to restart your application after turning logging on or off. You'll find the log files created in your %temp% directory. The files will have a name like YOURAPPLICATION.bkgrnd.glf, YOURAPPLICATION.Diagnostics.glf, and YOURAPPLICATION.functions.glf.

These are very verbose logs and will be overwhelming at first. I suggest to open them in Excel and work your way from the end of the log backwards. The functions log will tell you the most info about the internal function calls used. It's also the largest log.