2012-02-24 4 views
4

Visual Studio 2010의 ReportViewer 10.0.0.0을 웹 응용 프로그램에 사용하고 있는데 어셈블리에 문제가 있습니다. 서버에 ReportViewer 8.0.0.0 및 9.0.0.0이 설치되어 있으며 버전 10.0.0.0 설치를 피하려고합니다.VS2010의 ReportViewer 어셈블리 관련 문제

ReportViewer10 dll이 서버에 설치되어 있지 않아도 가능하다고 생각했습니다. DLL의 Build Action 속성을 Content으로 설정하여 출력 bin 폴더로 복사합니다. 속성 Copy to Output DirectoryDo not copy입니다.

다음 오류가 보여 주므로 프로젝트에서 GAC에있는 ReportViewer와 Temporary ASP.NET Files에있는 두 개의 어셈블리를 찾습니다. 검색 중, 서버에 대한 각 요청이 Temporary ASP.NET Files으로 다시 생성되었음을 발견했습니다.

내 문제를 해결하려고 시도한 결과 Temporary ASP.NET Files에서 dll을 삭제했으며 응용 프로그램이 작동하지 않아 응용 프로그램이 GAC 또는 bin 폴더가 아닌 Temporary ASP.NET Files의 dll을 사용하고 있음을 보여줍니다. bin 폴더의 dll 또는 Temporary ASP.NET Files을 사용하도록 응용 프로그램을 설정하고 싶습니다. dll이 올바른 버전 (10.0.0.0)이기 때문입니다. 아래 오류는 GAC의 ReportViewer9 dll과 Temporary ASP.NET Files의 ReportViewer10 DLL 간의 충돌을 보여줍니다.

은 내가 DLL을 내 프로젝트에 의해 참조 될하지만 bin 폴더에서 그들을 제거했습니다 왼쪽 :

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 

답변

6

내 문제는 다음을 수행하여 해결되었다. 충돌을 종료 dll을의 임시 ASP.NET 파일 폴더 안에 다시 생성되는 멈춘이 방법은 :

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' 

보고서 뷰어가 예상 된 방법, 작동하지 않는 (GAC는 버전 8과 DLL을 9 있었다 보관). 그런 다음 보고서 뷰어 10.0.0.0는 서버에 설치되었고, 이번에는 새로운 오류가 나타났습니다 :

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\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' 

내가 그이 충돌이 DLL을 다른 버전 사이에 무슨 일이 있었 이상한라고 생각하고,이 시간 솔루션은 web.config 파일에 다음 태그를 추가했다 :

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727"> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="b03f5f7f11d50a3a"/> 
    <bindingRedirect oldVersion="9.0.0.0" newVersion="10.0.0.0"/> 
    </dependentAssembly> 
</assemblyBinding> 

을 완료. 그것은 충돌없이 작동했으며 보고서를 내보낼 수있었습니다.

내 문제는 해결되었다,하지만, 난 여전히 하나의 의심의 여지가 있고, 나는 누군가가 나를 도와 희망이 하나

왜 서버가 가지고 않았다 다른 버전에서 GAC_MSIL 두 dll을의 사이의 갈등? 서버가 내 프로젝트에서 참조하고 Web.config에 지정된 버전 만 찾으면 안됩니까? (10.0.0.0)

machine.config 파일과 관련이 있습니까?