When a .NET site fails to start on IIS 5: Migration Woes Part 5
One of my test machines runs IIS 5.0 on Windows 2000 Service Pack 4. It ran a website based on ASP.NET 1.1 which I migrated into a nice .NET 2.0 Web Application Project [http://webproject.scottgu.com/]. This built and ran fine on both Windows XP and Windows 2003 but when it was installed to the Windows 2000 box, I got that less than encouraging page in my browser that reads ‘Server Application Unavailable’ in big red letters along with a note to check the error log.
The Error log had three errors:
- Error : aspnet_wp.exe stopped unexpectedly * Error : Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80131902 * Warning : Failed to initialize the AppDomain:/LM/W3SVC/1/Root & Exception: System.Configuration.ConfigurationErrorsException
For me at least, this had a rather simple solution, but there were several other solutions raised which I’ve gathered here for reference. Hopefully they are of some use.
- Check .NET 2.0 is installed. If it is, there’ll be a directory at %systemroot%/Microsoft.NET/Framework/v2.0.50727 if you have. If it isn’t, download the .NET redistributable from here [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en] and install it. 2. Check ASP.NET 2.0 is installed and registered in IIS 5.0. If you’re already running a .NET 2.0 website from this IIS box, you are. If not, try opening a command prompt, changing directory to the .NET 2.0 framework directory given in step 1 and running aspnet_regiis -lv. This will let you know exactly which versions of ASP.NET are running. If you don’t see an entry for v2.0.50727.0, then you’ll need to register it in IIS. Run aspnet_regiis -i to do this. 3. Right click the website your having difficulties with and select the ASP.NET tab. Make sure it is showing v2.0.50727 as the ASP.NET version. 4. Open the Windows Task manager dialog and hit the processes tab. Find the entry for aspnet_wp.exe in the list and make a note of the User name it is running under. By default, it is MACHINENAME, so I’ll refer to this. Repalce it with whichever account is running aspnet_wp on your machine. Go back to the IIS properties dialog for your website, select the operators tab and add MACHINENAMEto grant it operator privilieges. (This is what solved the issue for me). 5. Grant the MACHINENAMEaccount access to the IIS metabase by running aspnet_regiis -ga MACHINENAMEfrom the command prompt windows opened in step 2. 6. Check that MACHINENAMEhas the proper permissions to run ASP.NET applciations. The complete set of ACLs for this can be found here [http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx]. 7. Create a Custom Account to run aspnet_wp.exe rather than the current one. Note that MS assumes that if you’re doing this for .NET 2.0 you’re working with IIS 6.0 rather than IIS 5.0 so you’ll need to use this document which creates a custom account for ASP.NET 1.1 on IIS 5.0 [http://msdn.microsoft.com/library/en-us/dnnetsec/html/secnetht01.asp] as a base and diff it against this document which creates a custom account for ASP.NET 2.0 on IIS 6.0 [http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000009.asp]
Hopefully, I’ve not missed out anything. If I have, let me know and I’ll add it into the list.Posted on June 30, 2006 #Geek Stuff