【发布时间】:2012-03-14 19:35:21
【问题描述】:
我正在将 VisualStudio2010 中的 ReportViewer 10.0.0.0 用于我的 Web 应用程序,但它的程序集出现问题。 服务器安装了 ReportViewer 8.0.0.0 和 9.0.0.0,我试图避免安装 10.0.0.0 版本。
我在考虑是否可以在服务器上使用 ReportViewer10 dll,即使没有安装它。我将 dll 的 Build Action 属性设置为 Content,以便将它们复制到输出 bin 文件夹。属性Copy to Output Directory 是Do not copy。
如以下错误所示,我的项目正在从 ReportViewer 中找到两个程序集,一个在 GAC 中,另一个在 Temporary ASP.NET Files 中。搜索,我也发现Temporary ASP.NET Files 是重新生成每个对服务器的请求。
为了解决我的问题,我从Temporary ASP.NET Files 中删除了 dll,整个应用程序停止工作,这表明我的应用程序正在使用来自 Temporary ASP.NET Files 的 dll,而不是来自 GAC 或 bin 文件夹。我想将我的应用程序设置为使用 bin 文件夹或 Temporary ASP.NET Files 中的 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
【问题讨论】:
标签: asp.net visual-studio-2010 dll assemblies reportviewer