sll552 / DiscordBee

MusicBee plugin that updates your Discord status with the currently playing track
Apache License 2.0
421 stars 31 forks source link

Cant initialise discordbee #63

Closed sirbonesbonesbones closed 3 years ago

sirbonesbonesbones commented 3 years ago

Describe the bug When I add the plugin, an error pops up saying "Exception has been thrown by the target of an invocation." The first time i downloaded discordbee it worked properly but i deleted it once and downloaded it again and it does this.

Screenshots image

Environment (please complete the following information):

Additional context I noticed "discord-rpc-w32.dll" wasnt in the plugin folder and the site says I need it. I'm not sure why it's not there though.

sll552 commented 3 years ago

Do you have the Windows Store version of MusicBee? Also please take a look at the error log (MusicBee -> Help -> Support ->Error log) if there is anything related to an exception. Did you try to close and reopen MusicBee after the error?

The dll is not needed anymore, I forgot to remove this from the plugin site. Also is there a reason why you are using an older version of MusicBee? Current version should be 3.3 with 3.4 being released soon (https://getmusicbee.com/forum/index.php?topic=32142.msg189636#msg189636)

sirbonesbonesbones commented 3 years ago

Oh, no I have the installer edition of MusicBee. And it does say target invocation exception in the error log. Yes I did close and reopen Musicbee and I restarted my computer as well.

Also I did not realise I was using an older version, I just went off what it said on the website, oops. image Ah okay I don't need the dll

sll552 commented 3 years ago

Also I did not realise I was using an older version, I just went off what it said on the website, oops.

I was talking about your version of MusicBee, in the initial message you stated that you are using 3.2.6345 which is old. The plugin version 1.4.0 is fine.

sirbonesbonesbones commented 3 years ago

OHH I'm sorry. I'll get the newst version of MusicBee to see if that'll make a difference.

Svarr commented 3 years ago

I have the same problem. Latest stable MusicBee and PlugIn version (downloaded both just a few minutes ago).

This is the full stack trace:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'DiscordRPC, Version=1.0.175.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at MusicBeePlugin.Plugin..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase)
   at #=z_aDAVc7sMkwkYxQETg==..ctor(#=zoKrwgApZgrrQua03HQ== #=zmYRlZmg=)

Maybe there still is a dependency to the Discord RPC library?

Svarr commented 3 years ago

Ok, in my case it was mostly my own fault (who would've known...). I put all of the plugins files into a folder (to keep multiple plugins separated in case I add some in the future). MusicBee doesn't seem to look for plugins recursively (i.e. only in the Plugins folder but not subfolders), so DiscordBee didn't show up. That led me to use the "Add Plugin..." button which added a stump entry that couldn't initialise (see error in the post above). By looking into the MusicBee3Settings.ini I found out, that said entry referenced the Plugins folder in AppData\Roaming. MusicBee probably didn't copy all the files into that folder (or none if it was an Admin privileges thing).

Anyway, I fixed it by moving the files into the Plugins directory directly and removing the stump entry from the .ini file.

sirbonesbonesbones commented 3 years ago

I finally got it to work, I did what Svarr did and took the plugins out of the subfolder and it worked. Thank you!