C# – Do event handlers stop garbage collection if the hanlder is in a seperate assembly

assembliescevent handlinggarbage-collection

If I have a class declared in assembly A, and am listening to it in assembly B, will this prevent garbage collection. Its a common situation, such as the one where you are listening to a property of an object in the business model from the ui.

i saw this question which talks about event listeners and garbage collection, but this question does not reference more than one assembly. I would hope the answer is the same (i.e. event listeners do not stop an object getting garbage collected) but there is that cross assembly boundary consideration.

Best Answer

It is the same regardless of which assembly the classes originate from.