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?
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.
User contributions licensed under CC BY-SA 3.0