views:

19

answers:

1

I can receive events, using the AppDomain.AssemblyLoad event, but only for a particular app domain. If I have appdomains that recursively create more appdomains, I believe my AssemblyLoad event will not work for those "grand-child" appdomains.

How can I be sure to get an AssemblyLoad event triggered, regardless of what appdomain loaded an assembly?

A: 

Each AD will have to register its own AssemblyLoad event. You will obviously miss at least the 1st assembly you load into it. The idea of a "process-side" event is murky, these event handlers cannot share anything since each AD has its own garbage collected heap. I guess you could serialize info back to the primary AD.

Hans Passant
As a side note, do you happen to know if an assembly load event can "touch" or modify statics in the newly loaded assembly?
Brent Arias
Sure, each AD has its own statics storage area (loader heap).
Hans Passant