We help IT Professionals succeed at work.

Why is IIS Crashing With This Message?

ktola
ktola asked
on
I have an ASP.NET website that has been running fine for about 16 months until I "upgraded" it to start using the .NET 4.0 framework and I started building the codebase in Visual Studio 2010.

Now IIS crashes all of the time and it gives me the same error when it crashes (see below) despite the fact that this line is already in my web.config file.  The only way I can fix this issue is to turn off IIS, try browsing to the page (thus getting a website not found) and then turning IIS back on.

At first I thought this only occurred when I posted new code but now it is happening even when the code is not touched.

I am running IIS 7 on a Windows 2008 server using the ASP.NET v4.0 Application Pool (not the classic).  When the site goes down, it no longer appears to be registered to the application pool but when I perform the steps above, it once again appears in the Application Pool and the site works once again...

Please help!
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error 
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

Open in new window

Comment
Watch Question

Carl TawnSenior Systems and Integration Developer

Commented:
The message is telling you that you need to either browse to the page on the server, or turn custom errors off, in order to see the actual error message.

If you change your config line to the following then you should at least get the underlying error:
<customErrors mode="Off" defaultRedirect="mycustompage.htm"/>

Open in new window

Author

Commented:
Sorry - I copied in the wrong error - I usually get something about missing an HTTP Handler but niether error is actually relevant.
 
THe problem has something to do with the site getting deregistered from the ASP v4.0 Application Pool.  When I look at the application pool listing, when the site is down, the pool lists 0 applications.  When I stop and restart IIS - thus getting the site to work again - the application pool shows 1 application which is this website.
What could be causing the application pool to drop the website like that?

Author

Commented:
Here is the actual error...but again it is not REALLY the issue

Author

Commented:
Hmm - the code did not attached...
Server Error in '/' Application.
--------------------------------------------------------------------------------

The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration> 
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.InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration>

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: 


[InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <httpHandlers>
            <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
        </httpHandlers>
    </system.web>
</configuration>]
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded, Boolean forSubstitution, IScriptManager scriptManager) +4100334
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager) +860
   Telerik.Web.SkinRegistrar.ResolveStyleSheet(StyleSheetReference styleSheet, Page page, EmbeddedSkinAttribute attribute) +280
   Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +452
   Telerik.Web.UI.RadWindowManager.ControlPreRender() +753
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4185

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Open in new window

Senior Systems and Integration Developer
Commented:
Ok, that's a bit of an obscure issue. Is there any pattern to when this happens (particular page or action), or is it doing it as soon as you try and access the site?

May be worth taking a look at this and seeing if any of it sounds familiar: http://blog.fredrikhaglund.se/blog/2007/09/27/the-mysterious-problem-with-webresourceaxd/

Author

Commented:
It always occurs when I first access the site in that once I am on the site it never goes down.  That said, when it crashes is completely random - sometimes after a code push, yet I could do 100 code pushes with no ill effects.  Other times the site will not be touched for days and it will randomly go down.
Thank you for finding that article - I added in the Global.asax option and I will see if it helps!  I will respond back by Monday if there are no issues - otherwise I will get back sooner:(!

Author

Commented:
Thank you for those two additional links but my web.config is setup just fine and I am running under the 4.0 framework - this literally  has to do with the application pool losing the website for some unknown reason.

Author

Commented:
I think this did the trick1  So far the site has not crashed - fingers crossed!  Thanks.

Author

Commented:
Spoke too soon - the site just crashed again.  I am REALLY lost on how to fix this issue...

Author

Commented:
If anybody is looking for the solution, please read the following post - http://blog.fredrikhaglund.se/blog/2008/08/26/solution-to-webresourceaxd-exception/
In short, move the following line to the very top of your HTTPHandler section (and move its equivalent if you are using IIS 7 or above in the web server section):
 <add name="WebResource.axd" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />