SL5 PRISM 4.1 app upgraded to VS2012 (with async/await) very weird exceptions...

Mar 19, 2013 at 7:44 AM
Spent 4 hours trying to figure out spot where my app fails.
  1. It works when I access website via localhost/tms
  2. It fails at specific place when I access website via machine-name/tms
Specifically it starts initializing one of the modules and I subscribe for PRISM event:

this.EventAggregator.GetEvent<UserAuthenticationEvent>().Subscribe(this.UserAuthenticated, ThreadOption.UIThread);

I get exception "Microsoft.Practices.Prism.Events.DelegateReference.TryGetDelegate() to access method MyModule.UserAuthenticated(boolean)' failed.

As I say it works when I'm debugging and when I run with different name in browser. Very strange. I assume some kind of permissions? But why and what should I do?
Mar 19, 2013 at 8:02 AM
When converting to VS2012 I changed scope of method to Private. But it works under localhost!!! Very frustrating..
Mar 19, 2013 at 6:30 PM

Based on my understanding, when subscribing to events via the EventAggregator, the method supplied in the subscription must be public.

You can find more information in the following thread:

Federico Martinez