views:

363

answers:

2

I add a handler mapping to IIS7 (on Win7). It runs just fine until I publish a new build to http://localhost. Once I publish a new build, all the mappings I added are magically gone!!

[EDIT]
I am also losing all of my virtual directories during a publish.
[/EDIT]

Any tips/tricks for this?

+1  A: 

The handlers are now stored in the app's web.config instead of in the metabase. Because of that, if you copy out an old copy of the web.config, your changes are lost.

David
Keith Barrows
It is possible to use this same web.config on an IIS6 server as well. You have to add an entry to the machine.config to tell it to ignore the new web.config "system.webserver" element.
David
+1  A: 

Look at the system.webServer element of your web.config. One of mine looks like:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <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>
  </system.webServer>
Matt Wrock

related questions