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

问题描述:

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

I have an AspNet MVC project in Visual Studio 2017 that was previously developed in Visual Studio 2015. This project contains many rdlc files that were working fine until I edited one of them. Now, when I try to download the pdf from the rdlc edited I get this error:

此报告的定义无效或不支持 版本的Reporting Services.该报告的定义可能是 使用更高版本的Reporting Services创建或包含内容 根据Reporting Services格式不正确或无效的文件 模式.详细信息:报告定义的目标无效 命名空间 ' http://schemas.microsoft.com/sqlserver/reporting/2016/01/报告定义" 无法升级.

The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' which cannot be upgraded.

编辑的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.15 Microsoft.ReportViewer. Runtime.WebForms.12.0.2402.15 nuget程序包

The project is running with net framework 4.6.2 and it has installed Microsoft.ReportViewer.Runtime.Common.12.0.2402.15 and Microsoft.ReportViewer.Runtime.WebForms.12.0.2402.15 nuget packages

我遇到了同样的问题,并且解决了该问题,它卸载了 Microsoft.ReportViewer.Runtime.Common Microsoft的nuget软件包. ReportViewer.Runtime.WebForms 并安装软件包 Microsoft.ReportingServices.ReportViewerControl.WebForms.140.340.80 .我想强调一点,我必须添加对 System.Windows.Forms 的引用,因为我用来呈现报告的类ReportDataSource中有一个依赖项

I had the same problem and I solved it uninstalling the nuget packages Microsoft.ReportViewer.Runtime.Common and Microsoft.ReportViewer.Runtime.WebForms and installing the package Microsoft.ReportingServices.ReportViewerControl.WebForms.140.340.80. I would like to highlight that I had to add a reference to System.Windows.Forms because there is a dependency in the class ReportDataSource that I use to render my reports