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
Did you drag the Crystal Report Viewer control from the toolbox to your web page? If not, try doing it that way. Visual Studio is usually good to find all the appropriate references and add them when you do things that way.
Aside from that, you may need to add some additional libraries to your web.config. In my apps using Crystal, I have the following files referenced:
<assemblies>
<add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Enterprise.Viewing.ReportSource, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</assemblies>
In addition, just before the closing system.web tag, I also have the following httpHandler added:
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
My app is using version 11r2 of Crystal Reports, so a few of the libraries may or may not exist, but most of them are the same.
Best Answer
One problem I suspect is that you're creating the CrystalReportViewer object (your
CrystalReportViewer1
) incorrectly.Rather than creating this object via declaration in your code, perhaps you need to create one by dragging and dropping the control onto your form's design surface from the toolbox.