Click here to Skip to main content
15,066,499 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\\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\\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

<%@ 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=, 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>

some part of config file

            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      validate="false" />
  <compilation debug="true">
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      <add assembly="Microsoft.ReportViewer.Common, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      <add assembly="Microsoft.ReportViewer.WinForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
pls give any suggession for this problem...?
Updated 23-Mar-17 11:09am
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...
bluesathish 7-Oct-13 4:45am
Try this, Go to Build menu and Click clean solution and Click Rebuild solution.
Faizymca 7-Oct-13 7:26am
thanx...Bluesathish sir for your suggestion i problems in every page change the version = as per as config file then rebuild sln...ok
bluesathish 7-Oct-13 7:32am
Thank you, i've posted my comment into the solution section for your question.
Faizymca 7-Oct-13 7:32am
Sir, Many thanx for u i hv another problem when i publish application upload on IIS(web server)then its give the error---
An error occurred during local report processing.
The definition of the report 'Main Report' is invalid.
An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC2001] file 'C:\Windows\TEMP\qo3mxhwo.0.vb' could not be found’. ---

So i think.. server doesn't have permission on this TEMP folder.

If your application is running under IIS, we need to grant permission (modify or edit) to account "ASPNET" or "NETWORK SERVICE" on this TEMP folder. how can i resolved its ...
Faizymca 7-Oct-13 3:04am
I also remove the all files "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" sir ....
Member 13329915 8-Aug-17 7:18am
I had Remove All my refrences agains reportviewer and clean solution and rebuield solution again but problem not solved

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.

check this link on the resolution to bind old and new Dll's in the config.

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="" newversion="" /><br />
  </dependentassembly><br />
</assemblybinding><br />
on web.config review assembly info. appear two times "Microsoft.ReportViewer.WebForms" one with and other with just get one of this.
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