Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"500 Internal Server Error" when adding HttpModule in my Website?

I am having a website (developed in ASP.NET 2.0 (C#)) registered with godaddy.com But when I am adding HttpModule in my web.config as follow:

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

but it gives me "500 Internal Server Error". When I removed the above tag then my website is working fine. Can anyone guess why its creating this problem??

like image 862
djmzfKnm Avatar asked Feb 21 '09 16:02

djmzfKnm


2 Answers

Got it guys :)

I was facing this problem since last October 2008, but finally I got this why? Instead of adding modules like I have added above in my question, use the following new module syntax made for IIS7 (godaddy is using IIS7 for windows hosting)

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

Place all your modules under here and you're done! It's nice and works perfect!

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

Do read more about this tag here http://www.iis.net/ConfigReference/system.webServer/modules

like image 87
djmzfKnm Avatar answered Oct 01 '22 01:10

djmzfKnm


What is WwwSubDomainModule? I strongly suspect you need to specify the namespace and possibly the assembly name. If you turn verbose error logging on, it should give you more information too.

like image 23
Jon Skeet Avatar answered Oct 01 '22 01:10

Jon Skeet