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. 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 and install it.
- 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.
- 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.
- 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\ASPNET, 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 MACHINENAME\ASPNET to grant it operator privilieges. (This is what solved the issue for me).
- Grant the MACHINENAME\ASPNET account access to the IIS metabase by running aspnet_regiis -ga MACHINENAME\ASPNET from the command prompt windows opened in step 2.
- Check that MACHINENAME\ASPNET has the proper permissions to run ASP.NET applciations. The complete set of ACLs for this can be found here.
- 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 as a base and diff it against this document which creates a custom account for ASP.NET 2.0 on IIS 6.0
Hopefully, I’ve not missed out anything. If I have, let me know and I’ll add it into the list.