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

+0

申し訳ありませんが、私はより明確にすべきでした。これは、これを参照するソリューションを構築しようとするときに発生します。私はその解決策を変更することはできません。 – user472875

+0

アセンブリは、参照している場所に存在しますか? 'c:\ Program Files \ Microsoft Visual Studio 10.0 \ ReportViewer \ Microsoft.ReportViewer.Common.dll' – Jeff

答えて

1

Microsoft.ReportViewer.WinForms.dllには、Microsoft.ReportingServices.ReportProcessing.RenderingResultを基本クラスとして使用するクラス定義があります。

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

コードのどこかでこのfooクラスを使用します。クラスRenderingResultは、Microsoft.ReportViewer.Common.dllで定義されています。このクラスでは、同じバージョンのRenderingResultを参照する必要があります。 Microsoft.ReportViewer.WinForms.dllの9.0バージョンとMicrosoft.ReportViewer.Common.dllの10.0バージョンを使用するため、一致しません。 RenderingResultは10.0バージョンでは異なるため、fooクラス定義は不完全です。

この問題を解決するには、一致するアセンブリを使用する必要があります。たとえば、これを修正するには、.csprojファイルのHintPathを手動で調整する必要があります。

+1

返事をありがとう。誰もがこの問題を抱えている場合、あなたの答えは正しいです。私はまだ問題を覚えており、ヒントパスを正しいバージョンに変更することで解決しました。ヒントパスを変更せずに間違ったDLLが参照されました。 – user472875

関連する問題