2012-03-08 69 views
1

我试图建立一个构建机器,并设法让所有东西都启动并运行。这是我坚持的最后一点。我试图取消/重新安装ReportViewer 10,并试图安装版本8和9,以查看它是否可以解决问题,但没有成功。反正这里的错误:MSBuild奇怪的构建问题

c:\Program Files\Microsoft Visual Studio 9.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll: error CS1684: Warning as Error: Reference to type Microsoft.ReportingServices.ReportProcessing.RenderingResult' claims it is defined in 'c:\ Program Files\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer. Common.dll', but it could not be found

同样,

c:\Program Files\Microsoft Visual Studio 9.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll: error CS1684: Warning as Error: Reference to type 'Microsoft.SqlServer.ReportingServices2005.Execution.Warning' claims it is defined in 'c:\Program Files\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer.Common.dll', but it could not be found

有没有人见过这个?

+0

何时发生此错误?在安装ReportViewer时? – Jeff 2012-03-08 20:48:46

+0

对不起,我应该更清楚一点:当我尝试构建引用它的解决方案时,会发生这种情况。尽管如此,我无法修改该解决方案。 – user472875 2012-03-08 20:50:42

+0

组件是否存在于它所引用的位置? 'c:\ Program Files \ Microsoft Visual Studio 10.0 \ ReportViewer \ Microsoft.ReportViewer.Common.dll' – Jeff 2012-03-08 20:52:57

回答

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类定义不完整。

要解决这个问题,你需要确保你使用的匹配组件,例如,你可能需要手动调整HintPath在.csproj的文件,以解决这个问题。

+1

感谢您的回复。如果有人遇到这个问题,你的回答是正确的。我仍记得这个问题,它通过将提示路径更改为正确的版本来解决。不改变提示路径,错误的DLL被引用。 – user472875 2012-11-02 17:55:05