I'm using the ReportViewer 10.0.0.0 from VisualStudio2010 into my Web Application and I'm having problems with it's assemblies. The server have ReportViewer 8.0.0.0 and 9.0.0.0 installed and I'm trying to avoid the installation of the 10.0.0.0 version.
I was thinking if it's possible to use the ReportViewer10 dll's on the server even not having it installed. I set the Build Action
property of the dlls to Content
for them to be copied to the output bin folder. The property Copy to Output Directory
is Do not copy
.
As the following error shows, my project is finding two assemblies from ReportViewer, one in the GAC and another in the Temporary ASP.NET Files
. Searching, I've discovered too that the Temporary ASP.NET Files
are re-generated each request to the server.
Trying to solve my problem, I deleted the dll from the Temporary ASP.NET Files
and the whole application stop working, showing that my application was using the dll from the Temporary ASP.NET Files
, not from GAC or the bin folder. I want to set my application to use the dll from the bin folder OR the Temporary ASP.NET Files
, because in these places the dll is in it's correct version (10.0.0.0). The error below shows a conflict between the ReportViewer9 dlls from GAC and ReportViewer10 dlls from Temporary ASP.NET Files
.
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