2012-03-08 45 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