CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both

15,298

Solution 1

Atlast I found.. The Problem is, In bin folder there is CrystalDecisions.Web.dll of version 10.2.51014.0 while i am adding reference i am adding 10.5.3700.0. So i have deleted dll from bin folder..Now Its working fine..

Thanks

Solution 2

In case you compiled older Crystal Report Viewer dotNET project (2.0 or 3.5) in Visual Studio 2013 (dotNET 4.0 or 4.5) and get the same error, my solution is to specify in the web.config the binding redirect of Crystal DLLs to the specific version. More info at:
MSDN: Redirecting Assembly Versions

Prerequsite: Installed SAP Crystal Reports, developer version for Microsoft Visual Studio, Support Pack 14 - v.13.0.14.1720 from the 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>
Share:
15,298
Admin
Author by

Admin

Updated on June 26, 2022

Comments

  • Admin
    Admin almost 2 years

    I am getting the following error while running crystal report

    CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\windows\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\f8ac550c\d919c1f5\assembly\dl3\21892670\002d6cd3_f2bfc501\CrystalDecisions.Web.DLL

    I am getting the above error after converting from framework 2.0 to 3.5. If I am creating new web application, I am not getting any error. I am getting error only for the converted application.

  • paulmelnikow
    paulmelnikow over 12 years
    Glad you solved it. Would you click the check mark next to this answer to indicate you've solved the problem?
  • Kusal Dissanayake
    Kusal Dissanayake almost 2 years
    This worked for me too. I had multiple versions of Crystal Reports installed. (32 bit and 64 bit) and there were some CrystalReport dlls remaining in the BIN folder even though I clean and build the solution. I deleted them and works now.