升级到最新 Crystal 报告运行时版本 13.0.21.2533 后出现 "Could not load type" 错误
Getting "Could not load type" error after upgrading to latest Crystal Reports Runtime version 13.0.21.2533
我们有一个工作应用程序,ASP.NET Web 表单,它使用 Crystal 报告运行时并在嵌入式打印预览中显示报告 window。它部署在 Windows 2012 服务器上,适用于 CR Runtime v13.0.18 及以下版本。
今天我们安装了最新的 Crystal Reports 运行时版本 13.0.21.2533(从 http://www.crystalreports.com/crvs/confirm/ 下载)并且打印预览 windows 现在引发此错误:
解析器错误
说明:解析服务此请求所需的资源期间发生错误。请查看以下具体的解析错误详细信息并适当修改您的源文件。
Parser Error Message: Could not load type 'MyApp.printPreview1'.
Source Error:
Line 1: <%@ Control Language="vb" AutoEventWireup="false"
CodeBehind="printPreview.ascx.vb" Inherits="MyApp.printPreview1"
EnableViewState="true" %> Line 2: <%@ Register
Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web"
TagPrefix="CR" %> Line 3: Source File:
/MyApp/printPreview.ascx Line: 1
回滚到 v..21 之前的任何版本似乎都可以正常工作,但这些旧版本已从 SAP/Crystal 网站上消失,迫使我们使用运行时 v..21。
这是一项重大更改,使我们应用程序中的所有报告都无法运行。
在此处查看有关此更新的 Crystal 网站后:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
具体来说:
Below items should be highlight for SP21:
...
- As most of CR/RAS .NET Assemblies are now re-versioned from 13.0.2000.0 to 13.0.3500.0, user MUST remove all old CR assemblies from Reference list and add the new version of CR assemblies, then
rebuild the application.
a. For those customer/user who do not
wanted to rebuilt their application, there’s workaround to use
<dependentAssembly>
in app.config/web.config, please see attachment.
看来您必须 a) 在 web.config 中将您的版本引用更改为 13.0.3500.0 并且 b) 在 Visual Studio.
中重建您的应用程序
这对我们来说并不是一个真正实用的选择,因为我们有几个 in-place 安装会立即中断,并且使用 in-production 实时应用程序重建并不简单。
相反,我们选择使用上面“4.a”点中列出的 dependentAssembly 方法。基本上我们所做的就是编辑 web.config 添加这个块:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ClientDoc" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonControls" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonObjectModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CubeDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataSetConversion" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ObjectFactory" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Prompting" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ReportDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.XmlSerialize" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
在结束 </configuration>
标记的正上方,保存,并且打印预览 window 开始工作。
这一直是一个可行的解决方法,直到我们推出一个新的 Crystal 二进制文件中内置的运行时引用的新版本。
我们有一个工作应用程序,ASP.NET Web 表单,它使用 Crystal 报告运行时并在嵌入式打印预览中显示报告 window。它部署在 Windows 2012 服务器上,适用于 CR Runtime v13.0.18 及以下版本。
今天我们安装了最新的 Crystal Reports 运行时版本 13.0.21.2533(从 http://www.crystalreports.com/crvs/confirm/ 下载)并且打印预览 windows 现在引发此错误:
解析器错误 说明:解析服务此请求所需的资源期间发生错误。请查看以下具体的解析错误详细信息并适当修改您的源文件。
Parser Error Message: Could not load type 'MyApp.printPreview1'.
Source Error:
Line 1: <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="printPreview.ascx.vb" Inherits="MyApp.printPreview1" EnableViewState="true" %> Line 2: <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %> Line 3: Source File: /MyApp/printPreview.ascx Line: 1
回滚到 v..21 之前的任何版本似乎都可以正常工作,但这些旧版本已从 SAP/Crystal 网站上消失,迫使我们使用运行时 v..21。
这是一项重大更改,使我们应用程序中的所有报告都无法运行。
在此处查看有关此更新的 Crystal 网站后:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
具体来说:
Below items should be highlight for SP21:
...
- As most of CR/RAS .NET Assemblies are now re-versioned from 13.0.2000.0 to 13.0.3500.0, user MUST remove all old CR assemblies from Reference list and add the new version of CR assemblies, then rebuild the application.
a. For those customer/user who do not wanted to rebuilt their application, there’s workaround to use<dependentAssembly>
in app.config/web.config, please see attachment.
看来您必须 a) 在 web.config 中将您的版本引用更改为 13.0.3500.0 并且 b) 在 Visual Studio.
中重建您的应用程序这对我们来说并不是一个真正实用的选择,因为我们有几个 in-place 安装会立即中断,并且使用 in-production 实时应用程序重建并不简单。
相反,我们选择使用上面“4.a”点中列出的 dependentAssembly 方法。基本上我们所做的就是编辑 web.config 添加这个块:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ClientDoc" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonControls" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonObjectModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CubeDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataSetConversion" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ObjectFactory" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Prompting" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ReportDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.XmlSerialize" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
在结束 </configuration>
标记的正上方,保存,并且打印预览 window 开始工作。
这一直是一个可行的解决方法,直到我们推出一个新的 Crystal 二进制文件中内置的运行时引用的新版本。