Catastrophic Failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

I came across the following IIS/ASP.NET while working on our production servers for RentToolbox.com:

     

Server Error in '/' Application.

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

     

[COMException (0x8000ffff): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))]

     

[FileLoadException: Could not load file or assembly 'Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))]

System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0

System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +72

System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58

System.Type.GetType(String typeName) +48

System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid() +9

System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection ps) +1800

System.Web.Configuration.CompilationSection.get_RecompilationHash() +68

System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(StandardDiskBuildResultCache diskCache) +741

System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(StandardDiskBuildResultCache diskCache) +46

System.Web.Compilation.BuildManager.PrecompiledAppRuntimeModeInitialize() +709

System.Web.Compilation.BuildManager.Initialize() +3581889

System.Web.Compilation.BuildManager.InitializeBuildManager() +228

System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +333

     

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))]

System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3540923

System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69

System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +275

     

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

     

The issue only appeared when ASP.NET was initializing on the first request from a web browser. If you requested the website a second time, the application would finally kick-in and start. However, if you restarted the W3SVC service (effectively reloading IIS and ASP.NET), and request the site again, you'll get the error. In a production environment, whenever you restart the W3SVC service, you don't want errors like this popping up.

I looked in C:\WINDOWS\assembly, and Microsoft.Jscript was in the GAC. I figured this might be a permission issue with the IIS worker process identity that ASP.NET uses. We currently host our web-app over a network share, and have a separate identity access the network share. So, I setup the worker process application pool identity to use a configurable identity instead of the predefined Network Service account.

Now, the problem seemed to have gone away. I guess it's one of those annoying mysterious windows flukes :) Oh, and don't forget to use:

aspnet_regiis.exe –ga UserAccount

To grant access to the IIS Metabase and permissions to the UserAccount running the worker process, otherwise, you'll get "Service Unavailable" errors.

Hope that helps.

   

Here's some more information that might be helpful:

http://forums.asp.net/t/991648.aspx