Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between <system.web> and <system.webServer>?

Every time I have to add a handler or module for ASP.NET with IIS7, the instructions always tell me to incorporate it into two sections: system.web and system.webserver.

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

And this:

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

What is the difference between these two sections?

In addition, if I don't add it to the system.web section, my Visual Studio 2008 debugger also doesn't work correctly.

like image 554
danmine Avatar asked Dec 10 '08 06:12

danmine


People also ask

What is system web?

HttpUtility Class (System.Web)Provides methods for encoding and decoding URLs when processing Web requests. This class cannot be inherited.

Where to place system webServer in web config?

The location element would refer to a specific section of the site, for example, an Administration location or something. For application wide <system. webServer> settings, the first example provided (without the location element) is the way to go. The example with the location tag is literally that.


2 Answers

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.

like image 150
Chris Avatar answered Oct 07 '22 22:10

Chris


The former is for Classic Mode.

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

like image 30
leppie Avatar answered Oct 07 '22 23:10

leppie