Attempted to access an unloaded appdomain calling AzMan

10,213

I'm having the same issue and stumbled across the following link

To summarize it appears that there is a folder change notification process that as you get more files/folder in your application it starts causing some timing issues. There is a link in the linked article that points toward a hotfix for the issue.

Share:
10,213
Thad
Author by

Thad

Microsoft MVP (Development Technologies) Senior Developer for SixPivot @DavidRGardiner

Updated on August 24, 2022

Comments

  • Thad
    Thad over 1 year

    In an ASP.NET MVC web application, I'm seeing the following error occaisionally:

    System.AppDomainUnloadedException: Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014) at System.StubHelpers.StubHelpers.InternalGetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis) at System.StubHelpers.StubHelpers.GetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis) at Microsoft.Interop.Security.AzRoles.IAzApplication.OpenOperation(String bstrOperationName, Object varReserved)

    The line in code where this exception is thrown is this one:

    IAzOperation operation = _azManApp.OpenOperation(operationName);
    

    Most of the time, the code works fine. When the error happens, it seems to reoccur a fair bit, such that recycling the AppPool is the only good remedy.

    What can I do to prevent this from happening?