Error when opening a View with Event Registration

Topics: CAB & Smart Client Software Factory
Jun 27, 2012 at 2:19 AM

Hi firnds, i have a very urgetn problem a i dont know how to solve this. I have a view which have the following event registration method:

<EventSubscription(EventTopicNames.EntitySavedEvent, ThreadOption.UserInterface)> _
    Public Sub EntitySavedEvent(ByVal sender As Object, ByVal e As EventArgs)
    End Sub


When the view is loaded for the first time everithing is ok, however when it is loaded the second time i get the a NullReferenceException and the StactTrace point to CAB, did anyone  came accross this issue before?

Thank in advance

Stack Trace

   en Microsoft.Practices.CompositeUI.EventBroker.WorkItemSubscriptions.Clean()
   en Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Clean()
   en Microsoft.Practices.CompositeUI.EventBroker.EventTopic.RemoveSubscription(Object subscriber, String handlerMethodName)
   en Microsoft.Practices.CompositeUI.EventBroker.EventInspector.HandleSubscriber(Object item, Boolean registerSubscriber, MethodInfo info, EventSubscriptionAttribute attr, WorkItem workItem)
   en Microsoft.Practices.CompositeUI.EventBroker.EventInspector.ProcessSubscribers(Object item, Type itemType, WorkItem workItem, Boolean registerSubscriber)
   en Microsoft.Practices.CompositeUI.EventBroker.EventInspector.Unregister(Object item, WorkItem workItem)
   en Microsoft.Practices.CompositeUI.BuilderStrategies.EventBrokerStrategy.TearDown(IBuilderContext context, Object item)
   en Microsoft.Practices.ObjectBuilder.BuilderStrategy.TearDown(IBuilderContext context, Object item)
   en Microsoft.Practices.CompositeUI.BuilderStrategies.CommandStrategy.TearDown(IBuilderContext context, Object item)
   en Microsoft.Practices.ObjectBuilder.BuilderStrategy.TearDown(IBuilderContext context, Object item)   en Microsoft.Practices.ObjectBuilder.BuilderStrategy.TearDown(IBuilderContext context, Object item)

Jun 27, 2012 at 5:47 PM
Edited Jun 27, 2012 at 6:19 PM


You could check the following threads, which I believe might be related to the problem you are describing:

I hope you find it useful,

Agustin Adami

Jun 29, 2012 at 7:23 PM

hi adami, sadly neither of the threads were of much help, i noticed that if instead of event i use command everything work as a charm, so i am inclined to thing that this is a bug in cab in WorkItemSubscriptions class, i am doing some test to see what come from it

Aug 28, 2014 at 10:20 PM
Hello <bat>,

Where you able to solve the issue?
I'm dealing with the same problem but in my case it's not at the second time.
I can open the View many times, but at some point this error come up and I wasn't able to identify exactly who is the one giving the <NullReferenceException>...

Thank you in advanced for everything.
Aug 29, 2014 at 12:36 AM