Based on OP comments, objects are created and then destroyed right after.
This is done by Publish("OtherModule"); do nothing because the listener has been destroyed.
Now really, if you set KeepSubscriberReferenceAlive to true ,
it will work because your EventAggregator will keep a reference to the subscribing object ( InfrastructureModule ).
This is not ideal, basically you switched from using a weak event pattern in which you do not risk memory leaks, to be able to work with objects of life and, therefore, to risk memory leaks, like a regular .NET event.
Don't get me wrong, I'm not saying that you should absolutely not use KeepSubscriberReferenceAlive, but it should be used only in rare cases.
At the same time, your test script is an odd script: Bootstrapper is called Initialize on each module you define, and then your shell does not support these modules. Since no one holds these Modules, they are destroyed.
The โnormalโ use for Initialize is to introduce a module that is initialized in Shell (or any other UserControl), and it makes sense: you do not want to initialize what you will not use.
source share