Visual Studio 2010のReportViewer 10.0.0.0をWebアプリケーションに使用していますが、アセンブリに問題があります。 サーバーにはReportViewer 8.0.0.0と9.0.0.0がインストールされていますが、10.0.0.0バージョンのインストールは避けようとしています。VS2010のReportViewerアセンブリの問題
ReportViewer10 dllをインストールしていなくても、サーバー上で使用することができると思っていました。 DLLのBuild Action
プロパティをContent
に設定して、それらを出力ビンフォルダにコピーします。プロパティCopy to Output Directory
はDo not copy
です。
次のエラーが示すように、私のプロジェクトでは、ReportViewerからGACに1つ、Temporary ASP.NET Files
に2つのアセンブリが見つかりました。検索すると、Temporary ASP.NET Files
がサーバーへのリクエストごとに再生成されることも発見されました。
Temporary ASP.NET Files
からDLLを削除しましたが、アプリケーション全体がGACまたはbinフォルダからではなく、Temporary ASP.NET Files
からのDLLを使用していたことを示しています。私はbinフォルダからdllを使用するように私のアプリケーションを設定したい、またはとします。なぜなら、dllが正しいバージョン(10.0.0.0)であるからです。以下のエラーは、GACのReportViewer9 dllとTemporary ASP.NET Files
のReportViewer10のDLLとの間の競合を示しています。
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
CS0433: The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both
'c:\\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\project\4ec9147f\d072b522\assembly\dl3\662a86a1\009c93d3_afeccc01\Microsoft.ReportViewer.WebForms.DLL'
Line 180:
Line 181: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 182: private global::Microsoft.Reporting.WebForms.ReportViewer @__BuildControlReportViewer1() {
Line 183: global::Microsoft.Reporting.WebForms.ReportViewer @__ctrl;
Line 184:
Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\project\4ec9147f\d072b522\App_Web_default.aspx.cdcab7d2.dmkwuxko.0.cs
Line: 182