"500 Internal Server Error" when adding an HttpModule to my site?

I have a website (developed in ASP.NET 2.0 (C #)) registered at godaddy.com But when I add the HttpModule to my web.config as follows:

<httpModules> <add type="WwwSubDomainModule" name="WwwSubDomainModule" /> </httpModules> 

but it gives me a "500 Internal Server Error". When I remove the above tag, my site is working fine. Can anyone guess why he is creating this problem?

+6
web-applications iis-7
source share
2 answers

He has guys :)

I have encountered this problem since last October 2008, but finally I understood why this is? Instead of adding modules, as I added above in my question, use the following module syntax created for IIS7 (godaddy uses IIS7 for Windows hosting)

 <configuration> <system.webServer> <modules> <add name="Header" type="Contoso.ShoppingCart.Header"/> </modules> </system.webServer> </configuration> 

Put all your modules here and you're done! It is nice and works great!

And "@Jon Skeet" there is no need to have a namespace for modules, even without a namespace you can make it work!

Learn more about this tag http://www.iis.net/ConfigReference/system.webServer/modules

+8
source

What is a WwwSubDomainModule ? I strongly suspect that you need to specify a namespace and possibly an assembly name. If you include the ubiquitous error log, it will also give you more information.

+1
source

All Articles