使用 Crystal Report 参考将 ASP.NET 2005 迁移到 2008 问题

发布于 2024-11-07 19:14:56 字数 2049 浏览 1 评论 0原文

ASP.NET网站是使用VS.NET 2005版本开发的,并使用了Crystal Reports。
现在同样想升级到 VS.NET 2008,但它显示如下错误:

错误 469 无法加载文件或程序集 'CrystalDecisions.CrystalReports.Engine,版本=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' 或其之一 依赖关系。系统找不到指定的文件。 C:\文档 和设置\管理员\桌面\SVSS\ssvs10022010123\Web.Config 29

在 web.config 文件中,代码的编写方式与此错误所指的位置相同。

<compilation debug="true">
        <assemblies>
            <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

Crystal Reports 已安装(VS2008 默认附带)。我们需要更改参考吗?
请指导我如何解决这个问题。

The ASP.NET website was developed using VS.NET 2005 version and used Crystal Reports.
Now the same wants to upgrade to VS.NET 2008, but it is showing errors like below:

Error 469 Could not load file or assembly
'CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its
dependencies. The system cannot find the file specified. C:\Documents
and Settings\Administrator\Desktop\SVSS\ssvs10022010123\Web.Config 29

In the web.config file, the code is written like where this error refers to.

<compilation debug="true">
        <assemblies>
            <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

Crystal Reports is already installed (which comes by default with VS2008). Do we need to change the reference?
Please guide me on how to fix this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南街九尾狐 2024-11-14 19:14:56

最好的解决方案是在服务器上安装相同的运行时。
无论如何,您可以在 app.config 或 web.config 中使用此 XML:

  <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>

其中 oldVersion 是您用于开发的版本,newVersion 是服务器上安装的版本

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

罗罗贝儿 2024-11-14 19:14:56

这是因为,.NET 2008 中的水晶报表版本已更改。

您应该将旧版本字符串替换为新版本,如下所示
Version=10.2.3600.0 到 Version=10.5.3700.0

在系统中查找 Crystal Report 的确切版本的替代解决方案是,

右键单击项目文件夹并选择引用。现在选择所有水晶报告参考并按确定。
它应该自动使用正确的版本更新 web.config 文件。 (可以在web.config中删除旧的水晶报表参考代码)。

This is because, the crystal report version is changed in .NET 2008.

You should replace your old version string with new version like this
Version=10.2.3600.0 to Version=10.5.3700.0

Alternate solution to find the exact version of Crystal report in your system is,

Right click on Project folder and choose reference. Now select all the crystal reports references and press Ok.
It should automatically update the web.config file with correct version. (You can delete the old crystal report reference code in web.config).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文