ASP.NET httphandlers webconfig file Integrated mode

659 Views Asked by At
  I have a web.config file which contains 

    <system.web>
    <httpHandlers>
    <add verb="*" path="*.pdf" type="InfomationDev.Info.write.writeModule, InformationDev.Info.write"/>
    </httpHandlers>
    </system.Web>
     **After running appcmd migrate command IIS6 to IIS7 we got new section**  



    <system.webServer>

 <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory" />
            <remove name="ScriptHandlerFactoryAppServices" />
            <remove name="ScriptResource" />
            <add name="*.pdf" verb="*" path="*.pdf" type="InfomationDev.Info.write.writeModule, InformationDev.Info.write"/>
            <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" />

  • The problem is: if I removed completely hhtpHandlers section it is working in Integrated mode. if I removed completely system.webserver section it is working in Classic mode. If I wanted to work on both modes(sometimes classic & Integrated) so I added both sections as shown above throwing exception 500 Internal server error.I want to work in both Integrated & classic modes without using validateIntegratedModeConfiguration="false". How can we do that?
0

There are 0 best solutions below