Issue with unhandled System.CannotUnloadAppDomainException RRS feed

  • Question

  • Hi, All,


    I am not sure if this is the right place for this post, but my question is related to the .NET framework. Things are like this:


    We have web application processing large data using thread.  It runs well about 6 months, but now it goes into the problem:


    An unhandled exception System.CannotUnloadAppDomainException occured in w3wp.exe. ...


    the thread processing the large volumn of the data is running about 7 hours now.


    I guess the problem is with that long running thread overlapping with the worker process w3wp.exe recyling itself. I am hoping that anybody can provide more information about this? like how to confirm this? How to add monitoring feature in event log? How to control the worker process recyling, ......





    Monday, February 4, 2008 7:30 PM


  • As a rule of the thumb you cannot really control when your worker process will be recycled. The only option is to create a second process and let this process do the actual processing. To diagnos ASP.NET problems you can contact Microsoft directly or you can have a look at one of the blogs of the ASP.NET escalation engineers.

    AppDomainUnloadExceptions do usually happen when you are still stuck in an unmanaged call that is not interruptible.
    To add monitoring you can simply add trace statements and check where you are going to. Check the MSDN docs about the Trace and Debug class in the System.Diagnostics namespace.

      Alois Kraus

    Tuesday, February 5, 2008 12:04 AM