我有一个非常相似的问题。突然之间,我无法再构建包含 .rdlc 文件的 VS2010 项目。我没有转换任何报告或使用报告服务器,一切都是本地的。我尝试创建一个全新的项目并添加一个空的新 rdlc 报告并点击构建,但它不起作用。就在一天它停止编译并给了我以下错误:
报告定义无效。详细信息:报表定义具有无法升级的无效目标命名空间“http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition”。
原来问题是我的“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ReportingServices\Microsoft.ReportingServices.targets”文件发生了某种变化。我的文件顶部是:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.Reporting.RdlCompile" AssemblyName="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
它应该是:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.Reporting.RdlCompile" AssemblyName="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
我更改了文件中的“使用任务”行,一切都重新构建了。真的很令人沮丧,它吞噬了我生命中的两天。
希望发表此评论可以帮助处于类似情况的其他人。
吉姆·拉弗勒