Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

In my machine visual studio 2005 and visual studio 2010 installed. I am working in asp.net and downloaded SAP Crystal Report with Visual Studio 2010. Now I am getting below error. How Can I Resolve it.

Any suggestion is highly appreciated.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Web.dll'


Thanks
Shafik
Posted

I found this with a simple search:

http://forums.asp.net/t/1781536.aspx/1[^]
 
Share this answer
 
Comments
[no name] 2-Nov-12 8:02am    
After 1 minute I found that link when i faced this issue.But that Solution is not working. Do you have any more Idea? Thanks for your Link.
There are 2 phases to solve this problem:

Phase 1: Make sure that your .net framework target is correct. (if using vs2008 it should be 3.5, if using vs2010 it should be 4.0 and 2.0 for vs2005)

Phase 2: Check the version of crystal reports you are using in your project/website and make changes accordingly to your web.config



Detailed Solution:

Phase 1:

1. on solution explorer, right click on your project, go to properties -> build
2. set target framework to 4.0 for vs2010 / 3.5 for 2008 / 2.0 for 2005

Phase 2:

1. check the version of crystal reports you are using
2. if you have dropped the crystal reports control on your aspx page, in the source you can see following line on the top:
HTML
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>



Note the version of crystal reports 10.5.3700.0

3. open your web.config file

you will see this code:
XML
<assemblies>
             <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
      </assemblies></assemblies>


4. just keep the 13.0 version entries in this code, and delete all other entries as follows:
XML
<assemblies>
  
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      </assemblies>










5. after doing this, try to rebuild or run the project and it will work.
 
Share this answer
 
v3
XML
Go in your web.config file and search for these lines:

<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

I am sure there are more than one reference for different version, so find the correct version and remove others.

 Hope this will help you
 
Share this answer
 
remove one your reference file and also the code
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900