views:

1674

answers:

3

Every time I have to add a handler or module for ASP.NET w/ IIS7, the instructions always tell me to put it into two places, the system.web and system.webserver.

<system.web>
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
</system.web>

And this:

<system.webServer>
    <modules>
    </modules>
    <handlers>
    </handlers>
</system.webServer>

What's the difference between the two?
Added: If I don't add it to my system.web, my VS 2008 debugger also doesn't work correctly.

+11  A: 

The system.web section is for configuring IIS 6.0, while the system.webserver version is used to configure IIS 7.0. IIS 7.0 includes a new ASP.NET pipeline and some configuration differences, hence the extra config sections.

However...

If you're running IIS 7.0 in integrated mode only, you shouldn't need to add the handlers to both sections. Adding it to system.web as well is a fallback for IIS 7.0 operating in classic mode, unless I'm mistaken. I've not done extensive testing on this.

See http://msdn.microsoft.com/en-us/library/bb763179.aspx for more information.

Chris
+3  A: 

The former is for Classic Mode.

The latter is for Integrated Pipeline Mode (available in IIS7+).

leppie
+2  A: 

a better current reference for this is: http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx

Shannon