After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630110 - Get single instance and remote control working on Win32
Get single instance and remote control working on Win32
Status: RESOLVED WONTFIX
Product: banshee
Classification: Other
Component: general
git master
Other Windows
: Normal normal
: 3.0
Assigned To: Banshee Maintainers
Banshee Maintainers
gnome[unmaintained]
: 641731 643230 643387 647213 650926 (view as bug list)
Depends on: 629844 725446
Blocks: 640997
 
 
Reported: 2010-09-20 02:16 UTC by Peter Johanson
Modified: 2020-03-17 08:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial ApplicationInstance and RemoteServiceManager work (42.16 KB, patch)
2010-09-20 02:19 UTC, Peter Johanson
none Details | Review
Follow-up to implement more 'remote control' functionality. (33.62 KB, patch)
2010-09-20 02:24 UTC, Peter Johanson
none Details | Review
Updated version, as one patch now. (77.46 KB, patch)
2010-09-21 20:39 UTC, Peter Johanson
none Details | Review
Updated version, fix conflict in one .csproj file (77.80 KB, patch)
2010-09-24 18:01 UTC, Peter Johanson
needs-work Details | Review
Updated patch to address reported issues. (77.97 KB, patch)
2010-09-30 20:04 UTC, Peter Johanson
none Details | Review
Fix to NDesk.DBus to allow ignoring MarshalByRefObject base class (1.20 KB, patch)
2010-10-10 23:13 UTC, Peter Johanson
none Details | Review
Updated version, now selects implementation at runtime. (78.30 KB, patch)
2010-10-10 23:14 UTC, Peter Johanson
none Details | Review
Updated version, with IDBusXXX renamed (103.00 KB, patch)
2010-11-23 23:12 UTC, Peter Johanson
none Details | Review
Updated patch against dbus-sharp branch (102.06 KB, patch)
2011-03-01 02:21 UTC, Peter Johanson
none Details | Review
Updated version, addresses GUI access issues (114.64 KB, patch)
2011-03-13 02:52 UTC, Peter Johanson
needs-work Details | Review
Patch to require dbus-sharp 0.8, and associated cleanups (7.08 KB, patch)
2014-02-27 19:19 UTC, Bertrand Lorentz
needs-work Details | Review

Description Peter Johanson 2010-09-20 02:16:20 UTC
Currently, single instance & remote control don't work at all on win32, thanks to the lack of DBus support there.

I'm attaching patches that implement single instance and remote control via .NET remoting (over an IPC channel).

Some existing names/concepts have been retained, that theoretically could be renamed to be more generic (e.g IDBusExportable -> IRemoteExportabe), but I haven't done that yet with the attached patches.

With each attachment, I will include questions about some of the approaches/changes made.
Comment 1 Peter Johanson 2010-09-20 02:19:26 UTC
Created attachment 170617 [details] [review]
Initial ApplicationInstance and RemoteServiceManager work

Initial pass at the refactor. This gets most things working, but a few items still fail to be registered due to them inheriting from existing classes. Follow-up patch fixes this issue.

With this change, single instance works, and some remote control from the command line works (e.g. queue-ing a new file by doing "Banshee.exe C:\Media\foo.mp3")
Comment 2 Peter Johanson 2010-09-20 02:24:14 UTC
Created attachment 170618 [details] [review]
Follow-up to implement more 'remote control' functionality.

This gets the rest of the expected remote objects working by adding an IDBusExportableProvider interface:

interface IDBusExportableProvider
{
     IEnumerable<IDBuxExportable> Exportables { get; }
}

And implementing it for the IClientWindow and IGlobalUIActions remote interfaces, since those currently inherit from existing base classes, instead of MarshalByRefObject.

Additionally, in order for the remote control to work with .NET remoting, it is no longer possible to duplicate the interface definitin from the Halie 'remote control client', since .NET remoting actually checks the specific type matches the remoted type. I've added a reference to Banshee.ThickClient now, and only specifically imported the interfaces in question... The alternative would be a new Banshee.ThickClient.Shared or somesuch... probably not worth another assembly just for this.

With this patch, the full 'remote control' client works, passing in --show, or --show-about, etc, etc.

Thoughts?
Comment 3 Andrés G. Aragoneses (IRC: knocte) 2010-09-20 08:05:44 UTC
Great stuff! (You should get Flattr and blog about this so you can get some cash for beers :)

My 2cents-review:

-    <ProductVersion>8.0.50727</ProductVersion>
+    <ProductVersion>9.0.21022</ProductVersion>

I wouldn't include these bits in the commit, although it's not a big deal. Not sure what version of VS the devs want to target...


+#if WIN32
+            instance = new IpcRemotingApplicationInstance ();
+#else
+			instance = new DBusApplicationInstance ();
+#endif // WIN32

+#if WIN32
+            manager = new IpcRemoteServiceManager ();
+#else
+			manager = new DBusRemoteServiceManager ();
+#endif // WIN32

In these 2 cases, I would advocate for using a new define, for example ENABLE_DBUS and connect it to the option --disable-dbus on the configure phase. This way the Remoting code path can also be enabled in Linux if needed, and I advocate ENABLE_DBUS as opposed to DISABLE_DBUS so Win32 builds are easier to trigger (I'm assuming most Linux devs would use the command line, for which ENABLE_DBUS would be enabled by default, but not VS devs).

But in this case I would maintain WIN32, or in the same vein as above, maybe UNIX?:

+        public static string ApplicationPath {
+            get
+            {
+#if WIN32
+                // TODO: Full installation path using registry key.
+                return "Banshee.exe";
+#else
+                return "banshee-1";
+#endif // WIN32
Comment 4 Peter Johanson 2010-09-20 12:35:38 UTC
As far as the version updates... that is required when using VS 2008, which is the minimum needed to compile this stuff... Can we instead just verify that MD plays nicely with that change, and include it? Otherwise continued work on Windows means constantly reverting that one line change before doing commits, it's likely to sneak in accidentally, etc.

I had thought previously that the IPC channels only worked on Windows (via named pipes), but I looked just now on github, and it seems Mono does have support for them. I will switch this to using an ENABLE_DBUS define.

As far as WIN32 vs UNIX for the check, it's fairly straight forward to add the define in the project files for the Windows target, I'd prefer to use the WIN32 define, as it is already used elsewhere in the code.
Comment 5 Andrés G. Aragoneses (IRC: knocte) 2010-09-20 15:01:39 UTC
(In reply to comment #4)
> As far as the version updates... that is required when using VS 2008, which is
> the minimum needed to compile this stuff... Can we instead just verify that MD
> plays nicely with that change, and include it? Otherwise continued work on
> Windows means constantly reverting that one line change before doing commits,
> it's likely to sneak in accidentally, etc.

/me nods
Wasn't opposed to it, but the perfectionist inside me would push that in a different commit :)

> I had thought previously that the IPC channels only worked on Windows (via
> named pipes), but I looked just now on github, and it seems Mono does have
> support for them. I will switch this to using an ENABLE_DBUS define.

Cool.

> As far as WIN32 vs UNIX for the check, it's fairly straight forward to add the
> define in the project files for the Windows target, I'd prefer to use the WIN32
> define, as it is already used elsewhere in the code.

True. But now that I think about it, I think it's always desirable to avoid defines as much as possible if it can be replaced by a runtime check (this way the assemblies are more similar regardless the platform). I normally see defines useful when a certain portion of the code can only work if the assembly is linked to an assembly that is used/existant only in that platform. But, as the first part of this comment, this is just a nitpick for perfectionists ;) I'm not by any means the maintainer that should review this patch.
Comment 6 Bertrand Lorentz 2010-09-20 18:57:55 UTC
It seems MonoDevelop is happy with the <ProductVersion>9.0.21022... thing

It keeps it as is when you edit the project options, and newly created projects even have it by default.

So I think we can change those piece by piece, until someone is bored enough to do it for all .csproj files ;)
Comment 7 Gabriel Burt 2010-09-20 22:50:39 UTC
Hey Peter, looks pretty nice!  Change the file headers to be Copyright you.  RemoteClientWindow.cs has the wrong filename in its header.
Comment 8 Peter Johanson 2010-09-21 17:08:39 UTC
Gabriel: I will double check all the new files are copyright me, and verify the filenames in the headers. I will not change the copyright to me for files I have just changed, though. Unless you meant those as well?
Comment 9 Peter Johanson 2010-09-21 20:39:55 UTC
Created attachment 170788 [details] [review]
Updated version, as one patch now.

Ok, lots of fixes/changes since last time:

1) Fixed copyright header info.
2) Made this whole ball of wax actually compile and run properly on Linux (tested on Ubuntu here). Key points:
    a) Fix the makefiles/build stuff,
    b) NDesk.DBus does bad, bad things to objects that subclass MarshalByRefObject, attempting to export their entire public API, instead of only exporting the types explicitly marked with the NDesk.DBus.InterfaceAttribute attribute. A hacky solution, until a proper fix in ndesk-dbus (or dbus-sharp?) can be found is to only conditionally make the classes inherit from MarshalByRefObject.
3) Used ENABLE_DBUS instead of WIN32 for determination of DBus vs .NET Remoting.
4) For now, hardcoded the ENABLE_DBUS when building with the makefiles (versus via VS solution files) (In thinking about it, the VS/MD files will probably need to have the ENABLE_DBUS define added for the profiles other than the Windows one)
Comment 10 Andrés G. Aragoneses (IRC: knocte) 2010-09-23 16:41:47 UTC
Great.

(In reply to comment #9)
> Created an attachment (id=170788) [details] [review]
> Updated version, as one patch now.
> 
> Ok, lots of fixes/changes since last time:
> 
> 1) Fixed copyright header info.
> 2) Made this whole ball of wax actually compile and run properly on Linux
> (tested on Ubuntu here). Key points:
>     a) Fix the makefiles/build stuff,
>     b) NDesk.DBus does bad, bad things to objects that subclass
> MarshalByRefObject, attempting to export their entire public API, instead of
> only exporting the types explicitly marked with the
> NDesk.DBus.InterfaceAttribute attribute. A hacky solution, until a proper fix

If it's a hack, I would advocate for, at least, filing a bug in dbus-sharp, and add a comment with the URL of the bug in every instance of the hack.

> in ndesk-dbus (or dbus-sharp?) can be found is to only conditionally make the
> classes inherit from MarshalByRefObject.
> 3) Used ENABLE_DBUS instead of WIN32 for determination of DBus vs .NET
> Remoting.
> 4) For now, hardcoded the ENABLE_DBUS when building with the makefiles (versus
> via VS solution files) (In thinking about it, the VS/MD files will probably
> need to have the ENABLE_DBUS define added for the profiles other than the
> Windows one)

Did you really test that with this, single instance detection is still working when using --disable-dbus ?
Comment 11 Peter Johanson 2010-09-24 18:00:48 UTC
Andres: Unfortunately we can't switch those at runtime *yet*, until the NDesk.DBus bug gets resolved. As is, we need to conditionally have our remoted types subclass MarshalByRefObject at compile time in order to have one or the other 'modes' work. ):

I can try to find time to add a fix/workaround for the NDesk.DBus issue, but in the meantime, the compile-time choice has to stay.
Comment 12 Peter Johanson 2010-09-24 18:01:45 UTC
Created attachment 171047 [details] [review]
Updated version, fix conflict in one .csproj file

An updated version that just fixes a conflict from one .csproj file that was changed by my other patch to add 'network status' support on windows.
Comment 13 Gabriel Burt 2010-09-30 19:33:55 UTC
Review of attachment 171047 [details] [review]:

You have some properties that don't follow the style guideline (they have their { on its own line).

Application.ApplicationPath should probably be named ExecutableName or something, no?

Looks like most if not all the new files' copyright headers have Copyright Novell still.

Can you only compile the System.Runtime.Remoting-dependent code if !DBUS_ENABLED, or perhaps only if explicitly asked for?

private string getServiceName method should start w/ a capital letter

In ServiceManager.cs can remove the line instead of commenting it out.

Why do we have to have RemoteGlobalUIActions etc classes now, where before we just had the GlobalUIActions etc classes themselves say they were IDbusExportable and that was it, right?
Comment 14 Peter Johanson 2010-09-30 19:41:23 UTC
[GB] Application.ApplicationPath should probably be named ExecutableName or
something, no?

I will rename.

[GB] Looks like most if not all the new files' copyright headers have Copyright
Novell still.

D'oh. Will fix that in my next patch.

[GB] Can you only compile the System.Runtime.Remoting-dependent code if
!DBUS_ENABLED, or perhaps only if explicitly asked for?

Yes, I can do that. Eventualy (probably once we move to dbus-sharp and I have a chance to put in some fixes/new API there) I would like to have it be a runtime selection instead of compile time.

[GB] Why do we have to have RemoteGlobalUIActions etc classes now, where before we
just had the GlobalUIActions etc classes themselves say they were
IDbusExportable and that was it, right?

The issue is the existing GlobalUIActions and the various implementations of IClientWindow have existing base classes, that cannot (nor should, IMHO) be easily changed. In order to be properly remoted via .NET remoting, the base class must be MarshalByRefObject. RemoteGlobalUIActions and RemoteClientWindow are just 'proxy classes' for any non-remotable implementation of the associated interface. I'm open to other solutions to that particular problem though.
Comment 15 Peter Johanson 2010-09-30 20:04:34 UTC
Created attachment 171453 [details] [review]
Updated patch to address reported issues.
Comment 16 Gabriel Burt 2010-09-30 22:28:59 UTC
Could we generate the proxy classes dynamically?  dbus-sharp does that in some cases, I believe.
Comment 17 Peter Johanson 2010-10-01 11:22:37 UTC
We certainly could. Any objections to using Castle DynamicProxy (http://www.castleproject.org/dynamicproxy/index.html) to do so, in order to avoid having to include tons of nasty System.Reflection.Emit in Banshee?
Comment 18 Andrés G. Aragoneses (IRC: knocte) 2010-10-05 08:59:48 UTC
(In reply to comment #11)
> Andres: Unfortunately we can't switch those at runtime *yet*, until the
> NDesk.DBus bug gets resolved. As is, we need to conditionally have our remoted
> types subclass MarshalByRefObject at compile time in order to have one or the
> other 'modes' work. ):
> 
> I can try to find time to add a fix/workaround for the NDesk.DBus issue, but in
> the meantime, the compile-time choice has to stay.

Isn't the generation of proxy classes dynamically kind of a big effort compared to maybe fix the dbus-sharp bug? Anyway I think a bug against dbus-sharp/ndeskdbus should be filed and write the URL of it in the patch. So people know why this hassle is done and, at some point when the bug is fixed, remove the cruft.
Comment 19 Peter Johanson 2010-10-10 23:13:32 UTC
Created attachment 172065 [details] [review]
Fix to NDesk.DBus to allow ignoring MarshalByRefObject base class

This is the necessary patch to NDesk.DBus needed for the next version of the Banshee changes. It adds a new attribute, IgnoreMarshalByRefObjectBaseClassAttribute that can be used to get NDesk.DBus to ignore the class when decided what API to export.
Comment 20 Peter Johanson 2010-10-10 23:14:49 UTC
Created attachment 172067 [details] [review]
Updated version, now selects implementation at runtime.

Updated version that selects the implementation to use at runtime.
Comment 21 Gabriel Burt 2010-11-05 21:01:12 UTC
Pete, you said you'd change a few things that are still called DBus* needlessly, right?
Comment 22 Peter Johanson 2010-11-23 23:12:26 UTC
Created attachment 175141 [details] [review]
Updated version, with IDBusXXX renamed

Ok, updated patch that includes renaming the IDBusXXX interfaces to IRemoteXXX instead, to better reflect their independence from the DBus specifics.

Still depends on the fix/patch to NDesk.DBus/dbus-sharp. Will work on getting that merged upstream.
Comment 23 Gabriel Burt 2011-02-07 15:31:19 UTC
*** Bug 641731 has been marked as a duplicate of this bug. ***
Comment 24 Gabriel Burt 2011-02-27 02:45:05 UTC
*** Bug 643230 has been marked as a duplicate of this bug. ***
Comment 25 Gabriel Burt 2011-02-28 22:18:14 UTC
*** Bug 643387 has been marked as a duplicate of this bug. ***
Comment 26 Gabriel Burt 2011-02-28 22:20:15 UTC
Hey Pete, is your patch in dbus-sharp now?  I'm wondering if maybe we should merge the dbus-sharp branch into banshee master for the Windows builds only.
Comment 27 Peter Johanson 2011-02-28 22:23:28 UTC
Gabriel,

It is not. I updated the dbus-sharp branch a while ago with the intention of rebasing my work on that branch, but have not had an opportunity to actually do that rebasing yet. It shouldn't be much work, I will try to find time to do that sometime this week.
Comment 28 Peter Johanson 2011-03-01 02:21:04 UTC
Created attachment 182154 [details] [review]
Updated patch against dbus-sharp branch

I've merge up the dbus-sharp branch on git.banshee.org with the latest from master, and rebased my work on the dbus-sharp branch.

To test on Windows, you'll need to first copy the dbus-sharp.dll and dbus-sharp-glib.dll from Linux into the windows-binaries checkout in bin\bin\.
Comment 29 Sandy Armstrong 2011-03-01 02:26:40 UTC
Peter, are we missing anything in upstream dbus-sharp?  Looks like your pull request in github got merged a couple of weeks ago:

https://github.com/mono/dbus-sharp/pull/11#issuecomment-754563
Comment 30 Peter Johanson 2011-03-01 02:39:31 UTC
Sandy,

Nope. dbus-sharp is fine. The only real blocker is waiting on the dbus-sharp branch to be merged to mainline (which, AFAIK, is waiting on dbus-sharp to be packaged for various distros)
Comment 31 Peter Johanson 2011-03-13 02:52:53 UTC
Created attachment 183259 [details] [review]
Updated version, addresses GUI access issues

Ok, here's an updated patch. Still against the dbus-sharp branch.

This version improves the .NET remoting support by ensuring the primary GDK lock is held when invoking all the remote calls.
Comment 32 Gabriel Burt 2011-04-08 19:19:55 UTC
*** Bug 647213 has been marked as a duplicate of this bug. ***
Comment 33 Andrés G. Aragoneses (IRC: knocte) 2011-11-07 15:03:50 UTC
*** Bug 650926 has been marked as a duplicate of this bug. ***
Comment 34 Andrés G. Aragoneses (IRC: knocte) 2013-10-09 10:03:43 UTC
Comment on attachment 183259 [details] [review]
Updated version, addresses GUI access issues

Quick review:

- This patch needs to be updated to apply cleanly to master.
- Pete's patch to dbus-sharp was merged, and the first version of dbus-sharp to ship this is the recently released (2 days ago) 0.8. This means that the patch needs to include a change on the configure phase to raise the dependency version number of dbus-sharp.
- The patch is still using the old name "IgnoreMarshalByRefObjectBaseClass", when it was decided to be named "ExportInterfaceMembersOnly" upstream: https://github.com/mono/dbus-sharp/commit/0536ba9848d9655504b127b5dc5f76fb93412146

This code:
+            ServiceNameOwner owner = null;
+            try {
+                owner = FindInstance<ServiceNameOwner> (serviceName, "/ServiceNameOwner");
+
+                return owner != null && owner.Ping ();
+            } catch (RemotingException) {
+                return false;
+            } finally {
+                if (owner != null) {
+                    try {
+                        ((IDisposable)owner).Dispose ();
+                    } catch { }
+                }
+            }

Can be much more simplified converting it to a "using () { }" block AFAIK. There are more cases in the patch like this, not only this one.

And last but not least, I still think this would be better as a runtime check:
+#if WIN32
+                // TODO: Full installation path using registry key.
+                return "Banshee.exe";
+#else
+                return "banshee-1";
+#endif // WIN32
Comment 35 Andrés G. Aragoneses (IRC: knocte) 2013-10-09 10:37:37 UTC
I also noticed this change:

-LINK_DBUS = $(DBUS_SHARP_LIBS) $(DBUS_SHARP_GLIB_LIBS)
+LINK_DBUS = $(DBUS_SHARP_LIBS) $(DBUS_SHARP_GLIB_LIBS) /define:ENABLE_DBUS

Not only this define shouldn't go assigned in a variable called "LINK_foo" (because it's only for references; therefore a _FLAGS one should be used I think), the ENABLE_DBUS define is actually not used anymore in the patch. Why?
Comment 36 Andrés G. Aragoneses (IRC: knocte) 2014-02-22 22:11:40 UTC
I'm porting the patch to git master (it doesn't apply, mainly because of this: https://github.com/GNOME/banshee/commit/b780ebced90e5aae3464e16fb686f25ddd21fd9b) and during this work I've noticed some things that I don't understand from the patch:

1) Why IpcRemotingApplicationInstance.ApplicationInstance is IDisposable if its Dispose() method is empty? (I'm going to remove this if nobody objects.)

2) Why IpcRemotingApplicationInstance.Connect() method does nothing?

Pete, I understand you are kind of less active these days, but would appreciate if you spent 5 mins to answer this :)

Cheers!
Comment 37 Andrés G. Aragoneses (IRC: knocte) 2014-02-23 13:43:29 UTC
We need to apply this patch from Chow before applying the fix for this: http://anonscm.debian.org/gitweb/?p=pkg-cli-apps/packages/banshee.git;a=blob;f=debian/patches/Use-dbus-2.patch;h=9ce676446f8838ad5427f37b3bd17a5867932490;hb=HEAD
Comment 38 Bertrand Lorentz 2014-02-25 18:24:12 UTC
(In reply to comment #37)
> We need to apply this patch from Chow before applying the fix for this:
> http://anonscm.debian.org/gitweb/?p=pkg-cli-apps/packages/banshee.git;a=blob;f=debian/patches/Use-dbus-2.patch;h=9ce676446f8838ad5427f37b3bd17a5867932490;hb=HEAD

I already have a patch somewhere for this, which does a bit more changes to remove some cruft in DBusServiceManager.

I'll commit it shortly, if that's OK.
Comment 39 Andrés G. Aragoneses (IRC: knocte) 2014-02-25 18:40:53 UTC
(In reply to comment #38)
> (In reply to comment #37)
> > We need to apply this patch from Chow before applying the fix for this:
> > http://anonscm.debian.org/gitweb/?p=pkg-cli-apps/packages/banshee.git;a=blob;f=debian/patches/Use-dbus-2.patch;h=9ce676446f8838ad5427f37b3bd17a5867932490;hb=HEAD
> 
> I already have a patch somewhere for this, which does a bit more changes to
> remove some cruft in DBusServiceManager.

Ah cool! BTW have a look at my recent commits in master, I also simplified some things around DBus.


> I'll commit it shortly, if that's OK.

I was thinking that we should only commit the migration to Dbus2 if we're going to commit the patch for this bug shortly after. And given that it's taking me a bit more time to port this patch to master, I'm leaning towards leaving this to after release 2.9.1, what do you think?

(I only want to commit 1 more thing, related to Gapless+GStreamerSharp into master to be 100% happy for a 2.9.1 release. Then we could work on this and GSettings for 2.9.2. What do you think?)
Comment 40 Andrés G. Aragoneses (IRC: knocte) 2014-02-27 12:50:47 UTC
(In reply to comment #39)
> > I'll commit it shortly, if that's OK.

If you don't mind, can you post here the patch first? I ask because today I found that Chow's patch doesn't work (it compiles, but it fails with the exception below when you try to run a 2nd banshee instance), so I wanted to test yours:

Unhandled Exception:
System.ArgumentException: Cannot create a struct with no fields
Parameter name: signature
  at DBus.Protocol.Signature.MakeStruct (Signature signature) [0x00000] in <filename unknown>:0 
  at DBus.Protocol.Signature.GetSig (System.Type type) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.SigsForMethod (System.Reflection.MethodInfo mi, DBus.Protocol.Signature& inSig, DBus.Protocol.Signature& outSig) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.GenHookupMethod (System.Reflection.Emit.ILGenerator ilg, System.Reflection.MethodInfo declMethod, System.Reflection.MethodInfo invokeMethod, System.String interface, System.String member) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.Implement (System.Reflection.Emit.TypeBuilder typeB, System.Type iface, System.String interfaceName) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.GetImplementation (System.Type declType) [0x00000] in <filename unknown>:0 
  at DBus.BusObject.GetObject (DBus.Connection conn, System.String bus_name, DBus.ObjectPath object_path, System.Type declType) [0x00000] in <filename unknown>:0 
  at DBus.Connection.GetObject (System.Type type, System.String bus_name, DBus.ObjectPath path) [0x00000] in <filename unknown>:0 
  at DBus.Connection.GetObject[IPlayerEngineService] (System.String bus_name, DBus.ObjectPath path) [0x00000] in <filename unknown>:0 
  at Banshee.ServiceStack.DBusServiceManager.FindInstance[IPlayerEngineService] (System.String serviceName, Boolean isFullBusName, System.String objectPath) [0x00000] in <filename unknown>:0 
  at Banshee.ServiceStack.DBusServiceManager.FindInstance[IPlayerEngineService] (System.String objectPath) [0x00000] in <filename unknown>:0 
  at Halie.Client.HandlePlayerCommands () [0x00000] in <filename unknown>:0 
  at Halie.Client.Main () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.AppDomain:ExecuteAssembly (System.AppDomain,System.Reflection.Assembly,string[])
  at System.AppDomain.ExecuteAssemblyInternal (System.Reflection.Assembly a, System.String[] args) [0x00000] in <filename unknown>:0 
  at System.AppDomain.ExecuteAssembly (System.String assemblyFile, System.Security.Policy.Evidence assemblySecurity, System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssembly (string,System.Security.Policy.Evidence,string[])
  at System.AppDomain.ExecuteAssembly (System.String assemblyFile) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssembly (string)
  at Booter.Booter.BootClient (System.String clientName) [0x00000] in <filename unknown>:0 
  at Booter.Booter.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Cannot create a struct with no fields
Parameter name: signature
  at DBus.Protocol.Signature.MakeStruct (Signature signature) [0x00000] in <filename unknown>:0 
  at DBus.Protocol.Signature.GetSig (System.Type type) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.SigsForMethod (System.Reflection.MethodInfo mi, DBus.Protocol.Signature& inSig, DBus.Protocol.Signature& outSig) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.GenHookupMethod (System.Reflection.Emit.ILGenerator ilg, System.Reflection.MethodInfo declMethod, System.Reflection.MethodInfo invokeMethod, System.String interface, System.String member) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.Implement (System.Reflection.Emit.TypeBuilder typeB, System.Type iface, System.String interfaceName) [0x00000] in <filename unknown>:0 
  at DBus.TypeImplementer.GetImplementation (System.Type declType) [0x00000] in <filename unknown>:0 
  at DBus.BusObject.GetObject (DBus.Connection conn, System.String bus_name, DBus.ObjectPath object_path, System.Type declType) [0x00000] in <filename unknown>:0 
  at DBus.Connection.GetObject (System.Type type, System.String bus_name, DBus.ObjectPath path) [0x00000] in <filename unknown>:0 
  at DBus.Connection.GetObject[IPlayerEngineService] (System.String bus_name, DBus.ObjectPath path) [0x00000] in <filename unknown>:0 
  at Banshee.ServiceStack.DBusServiceManager.FindInstance[IPlayerEngineService] (System.String serviceName, Boolean isFullBusName, System.String objectPath) [0x00000] in <filename unknown>:0 
  at Banshee.ServiceStack.DBusServiceManager.FindInstance[IPlayerEngineService] (System.String objectPath) [0x00000] in <filename unknown>:0 
  at Halie.Client.HandlePlayerCommands () [0x00000] in <filename unknown>:0 
  at Halie.Client.Main () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.AppDomain:ExecuteAssembly (System.AppDomain,System.Reflection.Assembly,string[])
  at System.AppDomain.ExecuteAssemblyInternal (System.Reflection.Assembly a, System.String[] args) [0x00000] in <filename unknown>:0 
  at System.AppDomain.ExecuteAssembly (System.String assemblyFile, System.Security.Policy.Evidence assemblySecurity, System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssembly (string,System.Security.Policy.Evidence,string[])
  at System.AppDomain.ExecuteAssembly (System.String assemblyFile) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssembly (string)
  at Booter.Booter.BootClient (System.String clientName) [0x00000] in <filename unknown>:0 
  at Booter.Booter.Main () [0x00000] in <filename unknown>:0
Comment 41 Bertrand Lorentz 2014-02-27 19:19:27 UTC
Created attachment 270504 [details] [review]
Patch to require dbus-sharp 0.8, and associated cleanups

Here's the patch I mentioned.
I did a quick test, and I didn't hit the ArgumentException you mention. I also remember doing more extensive tests right before dbus-sharp 0.8 was release, without noticing it.

On the question of whether to commit this before or after the release, I'm fine either way, I guess it would depend on you level of confidence with this change.
Comment 42 Andrés G. Aragoneses (IRC: knocte) 2014-03-01 15:17:23 UTC
(In reply to comment #41)
> Created an attachment (id=270504) [details] [review]
> Patch to require dbus-sharp 0.8, and associated cleanups
> 
> Here's the patch I mentioned.

Thanks, I think this is a much better patch.


> On the question of whether to commit this before or after the release, I'm fine
> either way, I guess it would depend on you level of confidence with this
> change.

I've given this some thought and I think I prefer to introduce this change after we release 2.9.1.
Comment 43 Andrés G. Aragoneses (IRC: knocte) 2014-03-18 10:38:18 UTC
Comment on attachment 270504 [details] [review]
Patch to require dbus-sharp 0.8, and associated cleanups

(In reply to comment #41)
> Created an attachment (id=270504) [details] [review]
> Patch to require dbus-sharp 0.8, and associated cleanups

Just one thing missing in this patch:
- banshee-collection-indexer.pc.in: dbus-sharp-2.0 instead of dbus-sharp-1.0
- build/pkg-config/banshee-core.pc.in: same as above, plus dbus-sharp-glib-2.0 instead of dbus-sharp-glib-1.0

Marking as needs-work so we don't forget this bit before committing it.
Comment 44 Andrés G. Aragoneses (IRC: knocte) 2014-03-18 11:11:22 UTC
(In reply to comment #43)
> ...

I've also tested this patch with d-feet (to instruct banshee to start playing, for example, on the PlayerEngine interface), and I got this error:

'GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.128 was not provided by any .service files'

Any idea of why is this? We should also probably move this conversation to bug 725446 because this is unrelated to single-instance in Win32.
Comment 45 Andrés G. Aragoneses (IRC: knocte) 2014-06-17 11:50:07 UTC
(In reply to comment #43)
> Marking as needs-work so we don't forget this bit before committing it.

FYI I've updated your patch to include the .pc.in file changes, and posted it to bug 725446.
Comment 46 André Klapper 2020-03-17 08:55:40 UTC
Banshee is not under active development anymore and had its last code changes more than three years ago. Its codebase has been archived.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Please feel free to reopen this ticket (or rather transfer the project
to GNOME Gitlab, as GNOME Bugzilla is being shut down) if anyone takes the
responsibility for active development again.
See https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/264 for more info.