CS0433:两者中都存在“CrystalDecisions.Web.CrystalReportViewer”类型

时间:2011-08-28 13:16:00

标签: asp.net crystal-reports

运行水晶报告时出现以下错误

  

CS0433:“CrystalDecisions.Web.CrystalReportViewer”类型存在于   都   'C:\ WINDOWS \组件\ GAC_MSIL \ CrystalDecisions.Web \ 10.5.3700.0__692fbea5521e1304 \ CrystalDecisions.Web.dll'   和'c:\ windows \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET   文件\根\ f8ac550c \ d919c1f5 \组件\ DL3 \ 21892670 \ 002d6cd3_f2bfc501 \ CrystalDecisions.Web.DLL

从框架2.0转换为3.5后,我收到了上述错误。如果我正在创建新的Web应用程序,我没有收到任何错误。我只为转换后的应用程序收到错误。

请帮我纠正这个

提前致谢

4 个答案:

答案 0 :(得分:3)

Atlast我发现.. 问题是, 在bin文件夹中有CrystalDecisions.Web.dll版本10.2.51014.0,而我正在添加引用我添加10.5.3700.0。所以我从bin文件夹中删除了dll ..现在它正常工作..

由于

答案 1 :(得分:1)

如果您在Visual Studio 2013(dotNET 4.0或4.5)中编译了较旧的Crystal Report Viewer dotNET项目(2.0或3.5)并得到相同的错误,我的解决方案是在web.config中指定Crystal DLL的绑定重定向到特定版本。 更多信息:
MSDN: Redirecting Assembly Versions

Prerequsite: 已从SAP Crystal Reports, developer version for Microsoft Visual Studio, Support Pack 14 - v.13.0.14.1720

安装SAP support page
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692FBEA5521E1304"/>
    <!-- Assembly versions can be redirected in app, 
      publisher policy, or machine configuration files. -->
    <bindingRedirect oldVersion="10.0.0.0-12.0.0.0" newVersion="13.0.2000.0"/>
  </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

答案 2 :(得分:0)

尝试删除这两个副本并重新安装运行时引擎以清除所有这些。

答案 3 :(得分:0)

我是一名网络程序员,我在2013版本和水晶报告中工作。我只是在解决这个问题。

  

首先你去你的asp.net项目,然后点击 bin 文件夹   看到水晶报告dll保存在这里。删除所有水晶报告DLL   在bin文件夹中,然后重新启动您的项目。就是这样。