We are getting this exception after a worker role has been operating fine in production for several weeks. Once this exception starts getting reported, it will keep getting it every time the worker role tries to access anything with the Diagnostics:
Not running in a hosted service or the Development Fabric
Note that the role is full trust, and as I mentioned this in in production on the Azure servers, NOT in debug. The worker role itself does some dynamic compilation, for which it needs to start a new AppDomain. It appears that the exception is coming from the spawned AppDomain when it occurs. The exception itself is triggered on a simple Trace.TraceInformation call.
What could cause this?
What can we do to recover from this?