dbus-sharp icon indicating copy to clipboard operation
dbus-sharp copied to clipboard

KeyNotFoundException thrown in NDesk.DBus.BusObject.ToggleSignal

Open knocte opened this issue 11 years ago • 2 comments

I just got this exception with Banshee using dbus-sharp 0.7:

[14 Debug 13:16:44.450] DAAP Proxy listening for connections on port 8089 [13 Debug 13:16:44.703] Found DAAP share Mediathek von Jordan, trying to resolve...

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2[NDesk.DBus.MatchRule,System.Delegate].get_Item (NDesk.DBus.MatchRule key) [0x00000] in :0 at NDesk.DBus.BusObject.ToggleSignal (System.String iface, System.String member, System.Delegate dlg, Boolean adding) [0x00000] in :0 at IAvahiServiceResolverProxy.remove_Found (Mono.Zeroconf.Providers.AvahiDBus.ServiceResolverFoundHandler ) [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.BrowseService.DisposeResolver () [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.BrowseService.Dispose () [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.ServiceBrowser.OnItemNew (Int32 interface, Protocol protocol, System.String name, System.String type, System.String domain, LookupResultFlags flags) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in :0 at NDesk.DBus.Connection.HandleSignal (NDesk.DBus.Message msg) [0x00000] in :0 at NDesk.DBus.Connection.DispatchSignals () [0x00000] in :0 at NDesk.DBus.PendingCall.get_Reply () [0x00000] in :0 at NDesk.DBus.Connection.SendWithReplyAndBlock (NDesk.DBus.Message msg) [0x00000] in :0 at NDesk.DBus.BusObject.SendMethodCall (System.String iface, System.String member, System.String inSigStr, NDesk.DBus.MessageWriter writer, System.Type retType, System.Exception& exception) [0x00000] in :0 at IBusProxy.AddMatch (System.String ) [0x00000] in :0 at NDesk.DBus.Bus.AddMatch (System.String rule) [0x00000] in :0 at NDesk.DBus.BusObject.ToggleSignal (System.String iface, System.String member, System.Delegate dlg, Boolean adding) [0x00000] in :0 at IAvahiServiceResolverProxy.add_Failure (Mono.Zeroconf.Providers.AvahiDBus.ServiceResolverErrorHandler ) [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.BrowseService.Resolve () [0x00000] in :0 at Daap.ServiceLocator.OnServiceAdded (System.Object o, Mono.Zeroconf.ServiceBrowseEventArgs args) [0x0003c] in /home/knocte/Documents/Code/bansheeDEBUGUNMANAGED1/src/Extensions/Banshee.Daap/Daap/ServiceLocator.cs:129 at Mono.Zeroconf.Providers.AvahiDBus.ServiceBrowser.OnServiceAdded (Mono.Zeroconf.Providers.AvahiDBus.BrowseService service) [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.ServiceBrowser.OnItemNew (Int32 interface, Protocol protocol, System.String name, System.String type, System.String domain, LookupResultFlags flags) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in :0 at NDesk.DBus.Connection.HandleSignal (NDesk.DBus.Message msg) [0x00000] in :0 at NDesk.DBus.Connection.DispatchSignals () [0x00000] in :0 at NDesk.DBus.Connection.Iterate () [0x00000] in :0 at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.IterateThread (System.Object o) [0x00000] in :0 make: *** [run] Error 255

knocte avatar Oct 25 '13 16:10 knocte

When we forked NDesk.DBus, we changed the namesspace to just DBus. So, from your stack trace, it seems you're using the old version of NDesk.DBus, or maybe it's your Mono.Zeroconf which uses it.

bl8 avatar Oct 25 '13 16:10 bl8

Oh, interesting! This is using Ubuntu 13.04, and I got many versions at the same time:

$ dpkg --list | grep -i dbus | grep cil ii libdbus-glib1.0-cil 0.5.0-4 all CLI implementation of D-Bus (GLib mainloop integration) ii libdbus-glib1.0-cil-dev 0.5.0-4 all CLI implementation of D-Bus (GLib mainloop integration) - development files ii libdbus1.0-cil 0.7.0-5 all CLI implementation of D-Bus ii libdbus1.0-cil-dev 0.7.0-5 all CLI implementation of D-Bus - development files ii libndesk-dbus1.0-cil 0.6.0-6 all CLI implementation of D-Bus

knocte avatar Oct 25 '13 21:10 knocte