Monday, January 28, 2008

HTTP Error 500.19 - Internal Server Error

This is the problem I faced when I copied IIS 6.0 web application on to IIS 7.0. The steps that I executed are:
1. Copied the web application on to a different folder, C:\Users\Name\....\myWebSite.
2. In IIS 7.0, created a new 'Application' (please note that I haven't created virtual directory).
3. The physical folder location is same as defined in step 1 above.

I thought that I am done with my configuration, but when I tried to open 'Default.aspx' in the browser, I get this error.
Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x80070005
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://localhost/MyWeb/Default.aspx
Physical Path: C:\Users\LoggedOnUser\...\Default.aspx
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: file:///?\C:\Users\loggedOnUser\...\web.config
Config Source:
-1:
0:

More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
--------------------------------------------------------------------------------
Server Version Information: Internet Information Services 7.0.

Seeing this error, it striked in my mind that definitely it is related to configuration settings in IIS 7.0. I checked the following settings:
1. Authentication - It was disabled for 'Windows Authentication'. I enabled it for the web application.
2. But then also, when I tried to open the default page, i get the same error.
I was thinking that why it is not working, then thought to do some hit and trial versions. The very first step I did is to create a new application pool and instead of using 'NetworkService' as Identity, I set the identity to machineName\userName, in my case because I am not the domain user, so I used machineName\LocalAdministrator. And finally, I set the application pool of the web application to this new application pool.

Bingo! It worked!
I need to explore more of IIS 7.0 features, and actual differences / advantages.

No comments: