views:

487

answers:

5

Before we were not using Crystal Reports. In our project now we have added Crystal Reports to our project. When I transferred my project to the server it produced a Crystal error. I suspect that Crystal is not installed on the server. Then installed Crystal 11 on the server. The development machines have Crystal 8.5. The server produces this error at the application startup.

"Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified."

  • Is it possible to have two version reference in web.config? (i.e. crystal 8.5 & 11)

  • How can this issue be solved?

Using C#, Visual Studio 2005, and Crystal Reports 8.5 in the development environment.

A: 

It's just a version conflict, since your development machine is using an earlier version it's looking for that version of the .DLL file when you try to run it on the server. You're probably best off making sure the same version is installed on both your dev machine and the server, and then making sure your web.config using the DLL files from Crystal 11 in both.

The quick hack for now is to figure out the correct file version on the server, and enter that number into the web.config.

EDIT: The other option is to change the version of the .DLL in your web.config on the server, which is basically what the others are saying. The problem there is that you'll have to keep changing it every time you deploy... which would be very annoying. Plus you're testing on the dev machine isn't really valid because you're testing a different program. You're almost guaranteed to see bugs in production that you'll never see in DEV because something's changed between versions.

Is there some reason you can't install Crystal 11 on your dev PC?

Telos
is it possible can i use both version dll reference in web config ?
Kartik
No, I'm pretty sure it will complain about objects existing in two places...
Telos
A: 

You probably need to add the reference to that DLL in your project (or otherwise get it into your /bin folder.

Jeff Martin
Can you please explain more which dll is require?
Kartik
CrystalDecisions.ReportAppServer.ClientDoc that is version 10.2.3600
Jeff Martin
A: 

The error messages says it all, does your server have version 10.2.3600.0 of CrystalDecisions.ReportAppServer.ClientDoc with matching token in either the GAC or somewhere it will be found by your application or web site?

Sounds like you need a config update on the server.

Si
A: 

No, it is not possible to reference two different versions of the same named assembly.

One way to make this work is to have two different web.config files. One for dev, the other for production. As part of your deployment, simply use the prod version of the file. If your deployment is automated this should be as simple as deleting the dev web.config and renaming the production version after the files have been copied over.

Chris Lively
A: 

10.2.3600.0 is the version of Crystal Reports that was included with Visual Studio 2005 with the latest patch.

You need to install the Crystal Reports runtime for .net 2.0 on the server. You can obtain the runtime installers from a dev machine

x64 C:\Program Files (x86)\Microsoft Visual Studio 8\Crystal Reports\CRRedist\X64

x86 C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports

DaveWilliamson