将Visual Studio 2015更改为Visual Studio 2017后,RDLC报告停止工作

Fid*_*cia 10 c# asp.net-mvc rdlc visual-studio-2017

我在Visual Studio 2017中有一个以前在Visual Studio 2015中开发的AspNet MVC项目.该项目包含许多rdlc文件,这些文件在我编辑其中一个之前一直正常工作.现在,当我尝试从编辑的rdlc下载pdf时,我收到此错误:

此版本的Reporting Services无效或支持此报告的定义.报表定义可能是使用更高版本的Reporting Services创建的,或者包含基于Reporting Services架构格式不正确或无效的内容.详细信息:报表定义具有无效的目标命名空间" http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition ",无法升级.

编辑的rdlc将其命名空间从http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition更改为http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition

该项目使用net framework 4.6.2运行,并安装了Microsoft.ReportViewer.Runtime.Common.12.0.2402.15Microsoft.ReportViewer.Runtime.WebForms.12.0.2402.15 nuget包

小智 27

我有同样的问题,我解决了它卸载nuget包Microsoft.ReportViewer.Runtime.CommonMicrosoft.ReportViewer.Runtime.WebForms并安装包Microsoft.ReportingServices.ReportViewerControl.WebForms.140.340.80.我想强调一下,我必须添加对System.Windows.Forms的引用,因为ReportDataSource我在用于呈现报告的类中存在依赖项

  • 菲德尔感谢您清楚地问这个问题,非常感谢Lilliam的回答.这是3天我正在为此寻找解决方案.对于那些正在寻找WPF应用程序解决方案的人,您需要安装此软件包:**Microsoft.ReportingServices.ReportViewerControl.Winforms.140.340.80** (6认同)
  • https://www.nuget.org/packages/Microsoft.ReportingServices.ReportViewerControl.WebForms/Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms -Version 140.802.134 (2认同)