2012-08-30 81 views
7

我正在使用Visual Studio 2010,并安装了“Microsoft Report Viewer 2012 Runtime”,希望能够在SQL 2012中测试新的报告系统。之后,我清除了引用“Microsoft.ReportViewer。 WebForms“,并从我的工具箱中删除了ReportViewer控件,并添加了新版本11 ReportViewer。ReportViewer 11(2012)Visual Studio 2010

我加入了新的控制到测试页和一个它增加了这个寄存器测试页:

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> 

,并将其添加这些条目到Web.config:

<buildProviders> 
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
</buildProviders> 

<httpHandlers> 
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" /> 
</httpHandlers> 

<handlers> 
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
</handlers> 

工具箱中的控件是版本11的新增功能,但系统一直在尝试引用版本10版本。此外,当我尝试编译它时,我得到错误:

The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL' 
+0

此修复程序的问题对我来说。我正在使用Azure虚拟机作为Web应用程序,数据库服务器是另一个单独的虚拟机,因此安装Report Viewer运行时无助,因为它也需要安装SQL Feature Pack。我刚刚从另一台服务器上复制了Microsoft.ReportViewer.Common文件夹,那里工作和繁荣 http://ata2931977.blogspot.com/2015/06/running-rdlc-reports-on-azure.html –

回答

16

我想我有完全相同的问题。如果是这样,我的解决方案是删除引用ReportViewer的web.config中的所有条目,然后在引用中执行相同的操作,构建项目,然后在页面中重新添加报表查看器。

web.config将更新为新版本的新处理程序和程序集。

+1

这是我的问题以及。需要从我的web.config中删除虚假条目。关键的一步是在重新添加正确的参考之前进行重建。 – CobaltBlue

+0

这就是这这这这,你为什么不是答案!? – peroija

+0

@Telmo这不适合我。我删除了对版本10的引用,从web.config中删除了第10个条目,但这不会构建我的项目,因为ReportViewer库在此阶段不存在。当我通过nuget添加版本11时,它在package.config和v11引用中添加了条目,但未在web.config中添加任何条目。我现在得到一个运行时错误。 – nickornotto

0

我有同样的错误,并通过执行以下操作解决它:

  • 在aspx页面(HTML代码),更新版本@Register值对应于组件的版本我是用并用程序的正确值更新PublicKeyToken值。
0

在您的web配置中,这意味着您已指定v 10和11 dll。删除一个或另一个。

0

我已删除从package.config以下项和它的作品

<package id="MicrosoftReportViewerWebForms_v10" version="1.0.0" targetFramework="net45" /> 
相关问题