Sunday, October 11, 2009

Internal server error 500 while running asp.net application

I was getting "Internal server error 500" while running asp.net application.


Cause of Error Code 500
500 Internal Server Error is a general error code and does not reveal any informatino about the actual cause. You need to check the log files for more information i.e. (Event log - Eventviewer). You can also find more details for exact cause of error by disabling "Show friendly HTTP error messages" in your browser.

Solution of Error
Ones you have cause of error, solution would be simple. There could be different error for you, but for me this error was occurring because of following reason.

Event message: Unable to make the session state request to the session state server. Details: last phase='Sending request to the state server', error code=0x80072749, size of outgoing data=0

Exception type: HttpException
Exception message: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

Now,

After checking "Services" in Administrative tools of control panel I found that "Asp.net State Service" was not installed.

I have tried to reinstall asp.net state service again using following command.

c:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis -i

ones asp.net state service is installed you need to start the service and change the start up type option to automatic. Finally my asp.net application started working again.

More details for Win Vista Users

If you are running into above error, than try to check following.

1. Check whether IIS is Installed on your machine? (In Run dialogbox type: Inetmgr)

To Install IIS on Win Vista.

Control Panel > Programs and Features > Turns Windows features on or off

Select Ineternet Information Services from popup dialog and press ok button.

2. Open Services and check whether "Asp.net State Service" is installed? (In Run dialogbox type: services.msc)

To install asp.net state service. run following command from your command prompt and make sure that you are pointing to correct directory.

c:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis -i


ones asp.net state service is installed you need to start the service and change the start up type option to automatic. Finally my asp.net application started working again.

No comments:

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape