Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need some help with the following problem:

I've been using a MS ReportViewer component in a website for a while now, but recently I've been getting the error shown below.

The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll'

Summery Sir,
It's started an app in VS 2005 NET 2.0 / Sql 2005 / RDLC reporting services.

Now I wanted to switch to VS 2008 (to take advantage of NET 3.5). On the same PC. So installed VS 2008 and VWG for net 3.5 - all works ok. I had to install Sql 2008 / RDLC Reporting Services

When I open a report in VS 2008, it is converted to a new format. That's ok.

my aspx this

XML
<%@ Page Language="C#" MasterPageFile="~/M.master" AutoEventWireup="true" CodeFile="Abc.aspx.cs" Inherits="Reports_Abc" Title="Untitled Page" %>
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl"
    TagPrefix="uc1" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
    <uc1:WebUserControl ID="WebUserControl1" runat="server" />
    <rsweb:reportviewer id="ReportViewer1" runat="server" width="100%"></rsweb:reportviewer>
</asp:Content>



and
some part of config file

HTML
<system.web>
  <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
  <httphandlers>
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      validate="false" />
  </add></httphandlers>
  <compilation debug="true">
    <buildproviders>
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </buildproviders>
    <assemblies>
      
      
      <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      <add assembly="Microsoft.ReportViewer.WinForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    </assemblies>
  </compilation>
    
</system.web>
pls give any suggession for this problem...?
Posted
Updated 23-Mar-17 11:09am
v5
Comments
bluesathish 7-Oct-13 2:12am    
Go to Solution explorer and remove all 'Microsoft.ReportViewer.WebForms references. Then Add the references from your latest directory (VS2008). Go to Build menu and Click clean solution and Click Rebuild solution.
Faizymca 7-Oct-13 3:02am    
Thanx for reply sir, Sir i want to remove in solution explorer bt i have not found the remove Microsoft.ReportViewer.WebForms references. of right click of web application so here i clean the solution and build ...problem still reamin ...i am new sir pls help
bluesathish 7-Oct-13 3:15am    
Try to Click the reference from Solution explorer and press delete button from your keyboard. I'm not sure this is available in VS2008, since i'm using vs2010. Jusy try and revert.
Faizymca 7-Oct-13 4:13am    
ok sir, i also convert my code into VS 2010 ....and i 'll try according to u sir,

Delete all *.dll in bin folder of web application...
Faizymca 7-Oct-13 4:41am    
Sir i hv done like right click of web application in sln and add refference browse the dll and Delete all them in bin folder and restart the computer and add again build the sln but still problem remains...

Go to Solution explorer and remove all 'Microsoft.ReportViewer.WebForms references. Then Add the references from your latest directory (VS2008). Go to Build menu and Click clean solution and Click Rebuild solution.

Regards,
BlueSathish
 
Share this answer
 
check this link on the resolution to bind old and new Dll's in the config.

http://stackoverflow.com/questions/9429277/problems-with-reportviewer-assemblies-in-vs2010

example below

<runtime><br />
    <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesto="v2.0.50727"><br />
  <dependentassembly><br />
    <assemblyidentity name="Microsoft.ReportViewer.WebForms" publickeytoken="b03f5f7f11d50a3a" /><br />
    <bindingredirect oldversion="9.0.0.0" newversion="10.0.0.0" /><br />
  </dependentassembly><br />
</assemblybinding><br />
 
Share this answer
 
v2
on web.config review assembly info. appear two times "Microsoft.ReportViewer.WebForms" one with 12.0.0.0 and other with 11.0.0.0. just get one of this.
 
Share this answer
 
Comments
CHill60 23-Mar-17 20:39pm    
You haven't added any new information to solutions posted over 3 years ago. Please don't do this

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