NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 12 13 14 15 16 … 93 Next »
Resolving required plugin assemblies problem

 
  • 0 Vote(s) - 0 Average
Resolving required plugin assemblies problem
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#1
2011-02-04, 01:32 PM
My plugin is split up in to a number of dlls. Unless all the files are in the Plugins\Common folder I get this error:
Code:
2011-02-04 13:19:17.588    [DEBUG][1]    About to check for plugin interfaces in: C:\Documents and Settings\All Users\Documents\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.dll
2011-02-04 13:19:17.588    [DEBUG][1]    Plugin PDB also exists: C:\Documents and Settings\All Users\Documents\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.pdb
2011-02-04 13:19:17.760    [DEBUG][1]    Looking for assembly in (2) C:\Documents and Settings\All Users\Documents\NPVR\Plugins\common\MusicSpot.Common.dll
2011-02-04 13:19:17.760    [DEBUG][1]    Looking for assembly in (3) C:\Program Files\NPVR\Plugins\common\MusicSpot.Common.dll
2011-02-04 13:19:17.760    [ERROR][1]    Unexpected error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at NUtility.PluginRegistry.LoadPluginsFromRoot(String pluginDirectoryBase)

It never looks in the folder it found the plugin dll! I'm I doing something wrong? These extra dlls are not 'common' so shouldn't really be in the common folder.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2011-02-04, 07:57 PM
Its preference is to look for unresolved externals in the same directory as the plugin, then to fall back to looking for it in the common directories. Unfortunately it's not easy for the application to tell which plugin is having the unresolved external. It could have been any code loaded in the process. It tries to have a guess at it by looking at the current stack trace to see if it contains any classes it can definitely attribute to a certain plugin. In this case, I can see it is failing to determine which plugin is having the problem. (otherwise it'd have "Looking for missing assembly(1)" message in the log)
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#3
2011-02-04, 08:00 PM
Is the anything I can do to help it with guessing?
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2011-02-04, 08:10 PM
To be honest, I'm not sure. I'd probably have to put more logging in that logic to see what is happening in this case. Unfortunately I'm at a stage where I'm not able to do patches in there without breaking the rest of the app. I'm happy to work through this when the next release is out though?
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#5
2011-02-04, 08:17 PM
OK, I'll bump after the next release. Got a simple work around for the time being (put the files in the common folder).
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#6
2011-03-29, 01:11 PM
Bump. Log from v2.0.3 showing the same problem:

Code:
[...startup]
2011-03-29 14:03:49.367    [DEBUG][1]    Created mutex. Must be only instance.
2011-03-29 14:03:49.565    [DEBUG][1]    Version: 2.0.3
2011-03-29 14:03:49.567    [DEBUG][1]    SingleInstance()
2011-03-29 14:03:49.710    [INFO][1]    About to connect to remote recording service
2011-03-29 14:03:49.712    [DEBUG][1]    RecordingServiceProxy@exit
2011-03-29 14:03:49.747    [DEBUG][1]    Using skin: C:\Users\Public\NPVR\skin\Default\
2011-03-29 14:03:49.752    [DEBUG][1]    About to look for plugin directories in: C:\Users\Public\NPVR\Plugins\
2011-03-29 14:03:49.755    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Common.dll
2011-03-29 14:03:49.755    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Common.pdb
2011-03-29 14:03:49.755    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Favourites.dll
2011-03-29 14:03:49.757    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Favourites.pdb
2011-03-29 14:03:49.757    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.dll
2011-03-29 14:03:49.757    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.pdb
2011-03-29 14:03:49.825    [DEBUG][1]    Looking for assembly in (2) C:\Users\Public\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.825    [DEBUG][1]    Looking for assembly in (3) C:\Program Files (x86)\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.825    [ERROR][1]    Unexpected error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at NUtility.PluginRegistry.LoadPluginsFromRoot(String pluginDirectoryBase)
2011-03-29 14:03:49.825    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyFree.dll
2011-03-29 14:03:49.825    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyFree.pdb
2011-03-29 14:03:49.827    [DEBUG][1]    Looking for assembly in (2) C:\Users\Public\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.827    [DEBUG][1]    Looking for assembly in (3) C:\Program Files (x86)\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.827    [ERROR][1]    Unexpected error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at NUtility.PluginRegistry.LoadPluginsFromRoot(String pluginDirectoryBase)
2011-03-29 14:03:49.827    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyMetadata.dll
2011-03-29 14:03:49.827    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyMetadata.pdb
2011-03-29 14:03:49.830    [DEBUG][1]    Skipping non-existant plugin directory: C:\Program Files (x86)\NPVR\Plugins\
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#7
2011-03-29, 07:07 PM
I've got a similar issue (I think), but in my case I'm trying to use a third-party DLL that will only work if it's placed in the same location as NextPVR.exe.

It's mediaInfo.dll, and it comes with a C# wrapper class that does a whole bunch of [DllImport("MediaInfo.dll")] calls. Visual C# Express doesn't want to know about the DLL (probably because it's not a .Net assembly), but everything compiles and runs ok - so long as the DLL goes in the right place.

It would be nice to just leave it in with my plugin, but I'm guessing that's not possible? No big deal if it isn't, but this is all black-magic windows stuff to me...

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#8
2011-03-29, 07:15 PM
imilne Wrote:I've got a similar issue (I think), but in my case I'm trying to use a third-party DLL that will only work if it's placed in the same location as NextPVR.exe.

It's mediaInfo.dll, and it comes with a C# wrapper class that does a whole bunch of [DllImport("MediaInfo.dll")] calls. Visual C# Express doesn't want to know about the DLL (probably because it's not a .Net assembly), but everything compiles and runs ok - so long as the DLL goes in the right place.

It would be nice to just leave it in with my plugin, but I'm guessing that's not possible? No big deal if it isn't, but this is all black-magic windows stuff to me...

Iain
That looks like a native DLL rather .NET, so there probably isnt anything I can do about that one. I seem to remember reading that you can manually call the win32 LoadLibrary api, specifying a full path to the DLL (in your plugin directory), prior to calling any of calls that use that DLL then it should work correctly (since the calls resolve to the already loaded DLL).
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#9
2011-03-29, 07:25 PM
McBainUK Wrote:Bump. Log from v2.0.3 showing the same problem:

Code:
[...startup]
2011-03-29 14:03:49.367    [DEBUG][1]    Created mutex. Must be only instance.
2011-03-29 14:03:49.565    [DEBUG][1]    Version: 2.0.3
2011-03-29 14:03:49.567    [DEBUG][1]    SingleInstance()
2011-03-29 14:03:49.710    [INFO][1]    About to connect to remote recording service
2011-03-29 14:03:49.712    [DEBUG][1]    RecordingServiceProxy@exit
2011-03-29 14:03:49.747    [DEBUG][1]    Using skin: C:\Users\Public\NPVR\skin\Default\
2011-03-29 14:03:49.752    [DEBUG][1]    About to look for plugin directories in: C:\Users\Public\NPVR\Plugins\
2011-03-29 14:03:49.755    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Common.dll
2011-03-29 14:03:49.755    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Common.pdb
2011-03-29 14:03:49.755    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Favourites.dll
2011-03-29 14:03:49.757    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.Favourites.pdb
2011-03-29 14:03:49.757    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.dll
2011-03-29 14:03:49.757    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.NpvrSpotifyPlugin.pdb
2011-03-29 14:03:49.825    [DEBUG][1]    Looking for assembly in (2) C:\Users\Public\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.825    [DEBUG][1]    Looking for assembly in (3) C:\Program Files (x86)\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.825    [ERROR][1]    Unexpected error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at NUtility.PluginRegistry.LoadPluginsFromRoot(String pluginDirectoryBase)
2011-03-29 14:03:49.825    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyFree.dll
2011-03-29 14:03:49.825    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyFree.pdb
2011-03-29 14:03:49.827    [DEBUG][1]    Looking for assembly in (2) C:\Users\Public\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.827    [DEBUG][1]    Looking for assembly in (3) C:\Program Files (x86)\NPVR\Plugins\common\MusicSpot.Common.dll
2011-03-29 14:03:49.827    [ERROR][1]    Unexpected error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at NUtility.PluginRegistry.LoadPluginsFromRoot(String pluginDirectoryBase)
2011-03-29 14:03:49.827    [DEBUG][1]    About to check for plugin interfaces in: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyMetadata.dll
2011-03-29 14:03:49.827    [DEBUG][1]    Plugin PDB also exists: C:\Users\Public\NPVR\Plugins\Spotify\MusicSpot.SpotifyMetadata.pdb
2011-03-29 14:03:49.830    [DEBUG][1]    Skipping non-existant plugin directory: C:\Program Files (x86)\NPVR\Plugins\
If you rename the Spotify directory to 'MusicSpot' does it help?
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#10
2011-03-29, 07:28 PM
sub Wrote:That looks like a native DLL rather .NET, so there probably isnt anything I can do about that one. I seem to remember reading that you can manually call the win32 LoadLibrary api, specifying a full path to the DLL (in your plugin directory), prior to calling any of calls that use that DLL then it should work correctly (since the calls resolve to the already loaded DLL).

Ok, thanks. I'll get the google pigeons on the case and see what they can find.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (4): 1 2 3 4 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,735 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,296 2020-11-14, 08:01 PM
Last Post: sub
  NextPVR 5: When is PIN Required for API Access? pkscout 3 2,630 2020-05-26, 04:45 AM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,421 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,861 2014-11-14, 02:05 AM
Last Post: Benoire
  Trouble loading .NET System assemblies bgowland 3 2,345 2013-10-31, 02:37 AM
Last Post: bgowland
  API docs to help with plugin development? McBainUK 3 2,737 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,028 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,932 2013-03-12, 06:48 AM
Last Post: psycik
  Problem with preview image for Pending Recordings Northpole 2 1,967 2012-08-14, 02:56 AM
Last Post: Northpole

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode