C# – multiple versions of Crystal Reports in web.config

asp.netccrystal-reportsweb.config

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.

Best Answer

Best solution is installing same runtime on the server.
Anyway, you can use this XML in your app.config or web.config:

  <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
        <bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
        <bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
        <bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
      </dependentAssembly>
      <dependentAssembly>
        ...
    </assemblyBinding>
  </runtime>

where oldVersion is the version you use for development and newVersion is the version installed on the server