MSBuild奇怪的构建问题

时间:2012-03-08 20:23:04

标签: c# build reportviewer

我正在尝试设置一台构建机器,并设法让所有内容都运行起来。这是我坚持的最后一点。我试图取消/重新安装ReportViewer 10,并尝试安装版本8和9,看它是否能解决问题,但没有成功。无论如何这里是错误:

  

c:\ Program Files \ Microsoft Visual Studio 9.0 \ ReportViewer \ Microsoft.ReportViewer.WinForms.dll:错误CS1684:   警告为错误:引用类型Microsoft.ReportingServices.ReportProcessing.RenderingResult'声明它在'c:\中定义   Program Files \ Microsoft Visual Studio 10.0 \ ReportViewer \ Microsoft.ReportViewer。   Common.dll',但无法找到

同样地,

  

c:\ Program Files \ Microsoft Visual Studio 9.0 \ ReportViewer \ Microsoft.ReportViewer.WinForms.dll:错误CS1684:警告为错误:引用类型'Microsoft.SqlServer.ReportingServices2005.Execution.Warning'声明它是在'c:\ Program Files \ Microsoft Visual Studio 10.0 \ ReportViewer \ Microsoft.ReportViewer.Common.dll',但找不到它

有没有人见过这个?

1 个答案:

答案 0 :(得分:1)

Microsoft.ReportViewer.WinForms.dll中有一个类定义,它使用Microsoft.ReportingServices.ReportProcessing.RenderingResult作为基类;

public class foo : Microsoft.ReportingServices.ReportProcessing.RenderingResult
{
}

您在代码中的某处使用此foo类。课程RenderingResultMicrosoft.ReportViewer.Common.dll中定义。此类需要引用相同版本的RenderingResult。因为您使用9.0版本的Microsoft.ReportViewer.WinForms.dll和10.0版本的Microsoft.ReportViewer.Common.dll它们不匹配。 RenderingResult在10.0版本中有所不同,因此foo类定义不完整。

要解决此问题,您需要确保使用匹配的程序集,例如,您可能需要手动调整.csproj文件中的HintPath来解决此问题。

相关问题