locked
Server 2012 Report Viewer 2008 error RRS feed

  • Question

  • User-2006388156 posted

    We are upgrading a clients server from 2008 R2 Standard to 2012 R2 Standard.
    They have a web application the was developed in visual Web developer 2008 and ruining great on Server 2008.  We upgraded server 2008 to 2012 for security reasons, 2008 is EOL.
    Once the server was upgraded to 2012 we get this error. 
    The first entry (9.0.0.0) is the this DLL used in 2008 and in our web app, but 2012 has a conflict.  How can we remove the second DLL to revolve the conflict?


    Description: 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.

    Compiler Error Message: CS0433: The type 'Microsoft.Reporting.WebForms.LocalReport' 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\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\assembly\dl3\cf546f7e\10e464fc_043cd101\Microsoft.ReportViewer.WebForms.DLL'

    Source Error:


    Line 2842:        
    Line 2843:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
    Line 2844:        private void @__BuildControl__control35(Microsoft.Reporting.WebForms.LocalReport @__ctrl) {
    Line 2845:            
    Line 2846:            #line 133 "C:\inetpub\wwwroot\Report\StandardReports.aspx"

    Source File: c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_standardreports.aspx.1933d7c.lxenes1b.0.cs    Line: 2844

    Friday, February 28, 2020 5:05 PM

All replies

  • User-1330468790 posted

    Hi, daviddobson,

     

    You problem is what the error described that there is a conflict between two webforms dlls. 

    GAC: 

    The GAC (Global Assembly Cache) is a central reposiroty for assemblies to reside, ready for the CLR (Common Language Runtime) to convert the code into the native code for the host operating system to execute.

    As .NET is not specific to a "language", i.e. C#, VB, j# etc can be used to write .NET apps, the CLR interprets the real code which is in the Microsoft Intermediary Language (MSIL)

    GAC_MSIL is a shared location for the global assembly cache of microsoft intermediate language format dlls to reside.

     

    Temporary ASP.NET Files: 

    This files are re-generated each request to the server.

     

    The reason could be varies so that if you could provide us with more details of web.config, it would be much helpful to target the problem.

     

    Here I found some similar error message, you can refer to below link:

    1.In below link, the scenario of the problem is that the project works well in local but is failed to work in server machine.

    The problems is casued by wrongly using some DLLs from master application which is using a different version of webforms.

    The solution is moving the application one level higher then reports work fine with the new version

    For more understanding, see below link:

    https://forums.asp.net/t/2150594.aspx

    2.The below case shows the developer updated the version of Microsoft.ReportViewer.WebForms to 10 and it triggered a conflict between the DLLs in temporary ASP.NET Files and the DLLS in GAC_MSIL.

    The solution is removing the dlls from the bin folder and keep the old reference setting. The following step is to add <bindingRedirect> tag to the web.config and the project worked without any conflict then.

    For more understanding, see below link:

    https://stackoverflow.com/questions/9429277/problems-with-reportviewer-assemblies-in-vs2010

     

    Hope this can help you.

    Best regards,

    Sean

    Monday, March 2, 2020 9:50 AM
  • User-2006388156 posted

    This was added based on linked posts

    <dependentAssembly>
    <assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="89845dcd8080cc91" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
    </dependentAssembly>

    ----- Web.config ----

    <?xml version="1.0"?>


    <configuration>

    <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
    </sectionGroup>
    </sectionGroup>
    </configSections>
    <connectionStrings>
    <add name="MMSConnectionString" connectionString="Data Source=dirs104;Initial Catalog=MMS;Persist Security Info=True;User ID=mms3;Password=password1"
    providerName="System.Data.SqlClient" />
    <add name="DIR240" connectionString="Data Source=DIR240\SQLEXPRESS;Initial Catalog=msdb;Integrated Security=True"
    providerName="System.Data.SqlClient" />
    <add name="DIRS104" connectionString="Data Source=dirs104;Initial Catalog=MMS;Persist Security Info=True;User ID=dmd;Password=dir1024"
    providerName="System.Data.SqlClient" />
    </connectionStrings>
    <appSettings>
    <add key="DebugInfo" value="false"/>
    <add key="GridViewPageSize" value="25"/>
    <add key="GridViewPageSizeLarge" value="50"/>
    <add key="EncryptionKey" value="!@#$0987"/>
    <add key="MaxSDFSub" value="24"/>
    <add key="MaxListBox" value="10"/>
    <add key="ServiceDateWindow" value="365"/>
    <add key="WebServiceSDF" value="http://localhost:8081/Web_Services/SDF.asmx"/>
    <add key="WebServiceSN" value="http://localhost:8081/Web_Services/SessionNote.asmx"/>
    <add key="SQLCommandTimeout" value="300"/>
    <add key="BillGenSQLCommandTimeout" value="120"/>
    <add key="MainLayout_ShowRightBar" value="false"/>
    <!--
    <add key="EDIResponseFolderz" value="\\WEBFILES\Vol1\MCS\Down"/>
    <add key="MMSCommonFolderz" value="\\WEBFILES\Vol1\MCS"/>
    <add key="MMSFilesz" value="\\WEBFILES\Vol1\MCS\Files"/>
    <add key="MMSTemplateFolderz" value="\\WEBFILES\Vol1\MCS\Template"/>
    -->
    <add key="PATH_BAKz" value="BAK"/>
    <add key="PATH_ZIPz" value="ZIP"/>
    <add key="PATH_277z" value="277"/>
    <add key="PATH_835z" value="835"/>
    <add key="PATH_27Sz" value="27S"/>
    <add key="PATH_271z" value="271"/>
    <add key="PATH_ZZZz" value="ZZZ"/>
    <add key="PATH_997z" value="997"/>
    <add key="PATH_REJz" value="REJ"/>
    <add key="PATH_ACCz" value="ACC"/>
    <add key="PATH_EXTz" value="EXT"/>
    <add key="PATH_XERz" value="XER"/>
    <add key="PATH_270z" value="270"/>
    <add key="PATH_837z" value="837"/>
    </appSettings>
    <!--
    <connectionStrings>
    <add name="xxxMMSConnectionString" connectionString="Server=MCSWEB;Database=MMS;Uid=mms4;Pwd=Password1; timeout=600" />
    <add name="xxxSessionNote1" connectionString="Data Source=dirs104;Initial Catalog=MMS;Persist Security Info=True;User ID=mms3;Password=password1"
    providerName="System.Data.SqlClient" />
    <add name="xxxServiceProviderReport" connectionString="Data Source=dirs104;Initial Catalog=MMS;Integrated Security=True"
    providerName="System.Data.SqlClient" />
    </connectionStrings>
    -->
    <system.web>


    <trust level="Full" />
    <!-- 2013-05-29Added a 0 to 4096 -->
    <httpRuntime executionTimeout="9000" maxRequestLength="409600" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.
    -->
    <compilation debug="true">
    <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
    </compilation>
    <!--
    The <authentication> section enables configuration
    of the security authentication mode used by
    ASP.NET to identify an incoming user.
    -->
    <!--- Remove and add the next ........................................................................ -->
    <authentication mode="Windows"/>
    <sessionState timeout="35" />


    <!--
    <authentication mode="Forms">
    <forms loginUrl="login.aspx" timeout="1"/>
    </authentication>
    <!- until here ......................................................................................... -->

    <!--
    The <customErrors> section enables configuration
    of what to do if/when an unhandled error occurs
    during the execution of a request. Specifically,
    it enables developers to configure html error pages
    to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
    <error statusCode="403" redirect="NoAccess.htm" />
    <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>

    -->
    <!-- added //DMD -->
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

    <pages enableSessionState="true">
    <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>
    </pages>
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>
    </system.web>
    <system.codedom>
    <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/>
    </compiler>
    </compilers>
    </system.codedom>
    <!--
    The system.webServer section is required for running ASP.NET AJAX under Internet
    Information Services 7.0. It is not necessary for previous version of IIS.
    -->
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
    <remove name="ScriptModule"/>
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
    <remove name="WebServiceHandlerFactory-Integrated"/>
    <remove name="ScriptHandlerFactory"/>
    <remove name="ScriptHandlerFactoryAppServices"/>
    <remove name="ScriptResource"/>
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>

    <defaultDocument>
    <files>
    <add value="~/home.aspx"/>
    </files>
    </defaultDocument>

    </system.webServer>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="89845dcd8080cc91" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>

    Wednesday, March 4, 2020 4:47 PM
  • User-2006388156 posted

    I posted my web.config.

    Can you show me how i can resolve this issues with the duplicate report viewers?

    Wednesday, March 11, 2020 3:19 AM
  • User-1330468790 posted

    Hi, daviddobson,

    Since you have added the "bindingRedirect" in the web.config, the problem should not be caused by the mixed versions of the "ReportViewer".

    Though the version now is 11.0.0.0 but you said the correct one is 9.0.0.0.

    You should make sure you have used a correct version of the "ReportViewer".

     

    I notice that there are two assemblies which contains "Microsoft.Reporting.WebForms.LocalReport", one is in the GAC and another one is in your project. 

    Therefore, the solution is to delete the one that is in the project to use the one exists in the GAC.

    Follow the steps:

        1. Close  Visual studio and clear bin and obj folder in your project directory.

        2. Go to ‘'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\’  folder and delete folder ‘Temporary ASP.NET Files’. Note that you may get an exception if IIS is running.

        3. Rebuild your project and browse the page.

     

    Hope this can help you.

    Best regards,

    Sean

    Wednesday, March 11, 2020 9:11 AM
  • User-2006388156 posted

    i deleted ‘'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files’

    now i get this error


    Exception Details: System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.]
       System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +11468281
       System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +356
    
    [HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11432982
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4408276
    
    Friday, March 20, 2020 6:44 PM