views:

5853

answers:

5

After hosting an ASP.NET 2.0 web application on a windows 2000 server(IIS 5). I was unable to browse the web site.

The following error message was displayed on the browser and three Event Log entries were added...

Error Message on Browser

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.

Event Log Entries

Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1000
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: XXXXX
Description: aspnet_wp.exe (PID: XXXX) stopped unexpectedly.

Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1088
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: XXXXX
Description: Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied.

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1073
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: WEBDEV
Description: Failed to initialize the AppDomain:/LM/W3SVC/1/Root/WebApplicationName
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.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)

Any Ideas...

** Edit **

And Why System.IO.FileLoadException is thrown for accessing System.Web assembly ?

A: 

From the looks of it you have an incorrect permission set for your ASP.NET installation. Typically the best bet it to just uninstall and re-install the ASP.NET portion. You can do this easily by the following.

  1. Open command prompt to C:\windows\microsoft.net\framework\v2.0.50727
  2. run the following command: aspnet_regiis.exe -u
  3. run the following command: aspnet_regiis.exe -i

That will uninstall ASP.NET and re-install, that should then establish the proper permissions for the account.

Mitchel Sellers
A: 

This error means that your code has thrown an exception that has either crashed IIS, or forced it to shut down. Common exceptions that cause this are OutOfMemoryException and StackOverflowException.

You're getting a FileLoadException, but there could be an underlying OutOfMemoryException or similar that's actually the root cause of that. Without knowing what you're trying to load, and the code that's inside it, it's impossible to tell what's actually causing your problem.

The first thing I would do to rule out a problem with the loading assembly, though, is to try and reflect over it in a test harness and see if the same problem happens. If so, then the problem is with the DLL that you're trying to load, not IIS.

DannySmurf
+1  A: 

I discovered that when the web site folder was copied to the server it inherited the security permissions of the parent folder which only had permission for the Administrator, Administrators & System accounts.

I added

  • IUSER_MACHINENAME (Internet Guest Account)
  • ASPNET (ASP.NET Machine Account)

With Read & Execute, List Folder Contents and Read permissions.

Even though the problem is resolved I still have some questions

It's clear from the third event log entry that the ApplicationManager fails to create the HostingEnvironment which is in the System.Web assembly.

Since FileLoadException is thrown for System.Web it seems like the ASP.NET worker process doesn't have access to the GAC folder.

Why is the FileLoadException thrown for accessing System.Web?

Leyu
A: 

I have ths same problem except it couldn't go away with u'r solution. The message in the Event view is also different

EventType clr20r3, P1 aspnet_wp.exe, P2 2.0.50727.42, P3 4333aece, P4 system.web, P5 2.0.0.0, P6 4333aecd, P7 5ce, P8 47, P9 system.cannotunloadappdomain, P10 NIL.

For the odd of it the website works fine on my 2003/IIS6 development server ... when I'm taking it to the project server which is IIS5/Win2000 it crashes with the Application not available message....

Any help?

A: 

I had the same problem and it didn't go away with aspnet_regiis with -u and -i and many others suggested here. But after I cleaned “%windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files” folder and gave this folder read-write permissions to user from identity impersonate section in web.config, problem disappeared. It was not sufficient to give local ASPNET user those rights.

alpav