I recently had problems when trying to access a webservice installed on a web site in IIS 6.0. When browsing to the web service at http://server/webservice.asmx I recieved:
"Server Application Unavailable. The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request."
The application event log returned two errors:
Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1088
Description: Failed to execute request because the App-Domain could not be created. Error: 0×80070005 Access is denied.
Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1334
Description: Failed to initialize the AppDomain:/LM/W3SVC/2079486950/Root
Exception: System.IO.FileLoadException Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.
StackTrace: at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark) at System.Activator.CreateInstance(String assemblyName, String typeName) at System.AppDomain.CreateInstance(String assemblyName, String typeName) at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters) at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
I found various references related to "Failed to initialize the AppDomain:/LM/W3SVC/2079486950/Root"
One of which suggested that the error lay with .Net not having been registered with IIS.
To solve this, navigate to your .NET directory (something like C:WINDOWSMicrosoft.NETFrameworkv2.0.50727) in a command prompt and run the command aspnet_regiis.exe -i which will register ASP.NET with IIS
However – this returned an error: "The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible."
D.oH! wrong directory for the .Net Framework – we are on a 64bit server after all – try in cmd:
cd C:WINDOWSMicrosoft.NETFramework64v2.0.50727aspnet_regiis.exe -i
and you should then see…
Start installing ASP.NET (2.0.50727).
…………………………
Finished installing ASP.NET (2.0.50727).
Then…still no joy. Tried an iisreset without success.
So…More googling for:
"Failed to execute request because the App-Domain could not be created. Error: 0×80070005 Access is denied."
… revealed (damn! you have to love google!) a post by dclaassen which suggested permissions at the website root…
So, as instructed I tried adding the Network Service account with read permissions to the website root folder and… voila!
[additional: later reconfigured the webservices to use integrated authentication and set the web application hosting the webservices to use the main MOSS portal application pool. This meant the webservices would use the logged in user correctly]