Monday, April 13, 2009

Common Error with IIS7 "the 500 error message"

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

I was trying to invoke webservices for creating a web reference in visual studio project.

After publishing the SOA, I found out when I try to do a webreference through localhost (not localhost:someport) and call its giving an error following is the detailed error.




HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related
configuration data for the page is invalid.


Detailed Error InformationModule
IIS Web CoreNotificationBeginRequestHandlerNot yet determined
Error Code0x80070021
Config ErrorThis configuration section cannot be used at this path.
This happens when the section is locked at a parent level.
Locking is either by default (overrideModeDefault="Deny"),
or set explicitly by a location tag with overrideMode="Deny"
or the legacy allowOverride="false".
Config File
\\?\C:\inetpub\wwwroot\Exercise1BusinessFacade\web.config

Requested URLhttp://localhost:80/Exercise1BusinessFacade/wsUser.asmxPhysical PathC:\inetpub\wwwroot\Exercise1BusinessFacade\wsUser.asmxLogon MethodNot yet determinedLogon UserNot yet determined


Config Source
104: </modules>
105: <handlers>
106: <remove name="WebServiceHandlerFactory-Integrated">

The way it was solved are mentioned below

  1. browse to inetpub directory in windows explorer and right click on the directory name and go to properties---> security---> add ---> find user with name "IUSR_???" add that and giive it read, write and execute permissions to that directory
  2. go to %windir%\system32\inetsrv\config directory and look for "applicationHost.config" file. You have to allow overrides for "handlers" in the config file .
    Note: you have to start notepad with administrative rights to edit this config file.
  3. Finally if you have windows vista installed and that user control lock thing is enabled. It will cause the visual studio not to access the localhost webservice from within. So you have to go to start type "visual studio 2008" and in the search list above right click and start as an administrator.

Refer : http://support.microsoft.com/kb/942055/

No comments: