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

问题描述 投票:10回答:2

我在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.15和Microsoft.ReportViewer.Runtime.WebForms.12.0.2402.15 nuget包

c# asp.net-mvc visual-studio-2017 rdlc
2个回答
27
投票

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


-3
投票

我右键单击解决方案资源管理器中的rdlc文件,然后选择从服务器替换,它为我解决了问题。我认为vs 2017试图更新架构以使用不同版本的sql server并获取原始报告定义来修复它。也许,我不知道,但它对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.