NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 36 37 38 39 40 … 93 Next »
Missing assembly problem...

 
  • 0 Vote(s) - 0 Average
Missing assembly problem...
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#11
2008-01-02, 06:01 AM
JavaWiz Wrote:What's strange here, is the DLL that he's looking for (DvbtrLib.DLL) is specific to his plugin, and it seems that it is not found in his plugin directory(plugins/DVB-T Radio). For some reason, it tries to find it in another plugin directory (plugins/UKCinema), then in plugins/common.
Yeah, its certainly a bit odd. I'll have a think about it tonight to see if anything comes to me.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,589
Threads: 385
Joined: Dec 2004
#12
2008-01-09, 09:16 PM
Hi sub, Did you have any further thoughts on this?

I fixed my problem by putting the class library in the plugins\common folder as you suggested. This means the gbpvr framework / my plugin DLL happily find it.

Unfortunately, my command-line exe can't find it unless there's also a copy in my main plugin folder. No big deal as this plugin is still experimental but it would be cleaner if everything was in one place.

Cheers,
Brian
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#13
2008-01-09, 09:22 PM
bgowland Wrote:Hi sub, Did you have any further thoughts on this?

I fixed my problem by putting the class library in the plugins\common folder as you suggested. This means the gbpvr framework / my plugin DLL happily find it.

Unfortunately, my command-line exe can't find it unless there's also a copy in my main plugin folder. No big deal as this plugin is still experimental but it would be cleaner if everything was in one place.

Cheers,
Brian
I'm at work right now, but I think I can supply you code to put in your exe so that it will find it in the common folder. I'll post this evening when I get home.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#14
2008-01-09, 10:01 PM
bgowland Wrote:Hi sub, Did you have any further thoughts on this?
I did have an idea, but I didnt get around to investigating it at the time. Unfortunately I'm away from home at the moment, and only have web access so can check for a few days.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#15
2008-01-09, 10:19 PM
sub did implement the plugins\pluginName assembly resolution as well. I've been using it since 1.1.5 came out for my stuff.

So it sounds like you may be able to remove the dlls in the common folder if you don't want them duplicated (and you're on 1.1.5)



EDIT RE-read the posts again, and you can probably disregard my post as insane ramblings....
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#16
2008-01-10, 05:48 AM
For your exe, include the following.

When your program attempts to load a DLL, and it is not found, the eventHandler will be called. It will attempt to find the DLL in plugins common, then the GBPVR base directory. If not found, it will display an Error popup message box.

Code:
[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] System.Reflection;[/SIZE]
[SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][SIZE=2] Microsoft.Win32;[/SIZE]
[SIZE=2]...[/SIZE]

// Somewhere in the startup (most likely Main) include the following:
[SIZE=2][COLOR=#2b91af]AppDomain[/COLOR][/SIZE][SIZE=2] currentDomain = [/SIZE][SIZE=2][COLOR=#2b91af]AppDomain[/COLOR][/SIZE][SIZE=2].CurrentDomain;[/SIZE]
[SIZE=2]currentDomain.AssemblyResolve += [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]ResolveEventHandler[/COLOR][/SIZE][SIZE=2](ResolveAssemblyEventHandler);[/SIZE]

[SIZE=2]...[/SIZE]

[SIZE=2][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<summary>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#008000] Missing DLL resolver[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]</summary>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<param name="sender"></param>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<param name="args"></param>[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][SIZE=2][COLOR=#808080]<returns></returns>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]static [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Assembly[/COLOR][/SIZE][SIZE=2] ResolveAssemblyEventHandler([/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] sender, [/SIZE][SIZE=2][COLOR=#2b91af]ResolveEventArgs[/COLOR][/SIZE][SIZE=2] args)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#008000]  //This handler is called only when the common language runtime tries to bind to the assembly and fails.[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]  //Retrieve the list of referenced assemblies in an array of AssemblyName.[/COLOR][/SIZE]
[SIZE=2][COLOR=#2b91af]  Assembly[/COLOR][/SIZE][SIZE=2] MyAssembly, objExecutingAssemblies;[/SIZE]
[SIZE=2]  objExecutingAssemblies = [/SIZE][SIZE=2][COLOR=#2b91af]Assembly[/COLOR][/SIZE][SIZE=2].GetExecutingAssembly();[/SIZE]
[SIZE=2][COLOR=#2b91af]  AssemblyName[/COLOR][/SIZE][SIZE=2][] arrReferencedAssmbNames = objExecutingAssemblies.GetReferencedAssemblies();[/SIZE]
[SIZE=2][COLOR=#2b91af]  RegistryKey[/COLOR][/SIZE][SIZE=2] localMachine = [/SIZE][SIZE=2][COLOR=#2b91af]Registry[/COLOR][/SIZE][SIZE=2].LocalMachine;[/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] name = [/SIZE][SIZE=2][COLOR=#a31515]@"SOFTWARE\devnz"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#2b91af]  RegistryKey[/COLOR][/SIZE][SIZE=2] regKey = localMachine.OpenSubKey(name);[/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] key = [/SIZE][SIZE=2][COLOR=#a31515]"GBPVR InstallDir"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] gbpvrInstallDir = ([/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2])regKey.GetValue(key.ToUpper());[/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] dllFileWithoutExtention = args.Name.Substring(0, args.Name.IndexOf([/SIZE][SIZE=2][COLOR=#a31515]","[/COLOR][/SIZE][SIZE=2]));[/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] missingDllName = dllFileWithoutExtention + [/SIZE][SIZE=2][COLOR=#a31515]".dll"[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#008000]  // Default to gbpvr install directory[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] strTempAssmbPath = gbpvrInstallDir + missingDllName;[/SIZE]
[SIZE=2][COLOR=#008000]  //Build the path of the assembly from where it has to be loaded. [/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]  if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]File[/COLOR][/SIZE][SIZE=2].Exists(gbpvrInstallDir + [/SIZE][SIZE=2][COLOR=#a31515]@"Plugins\common\"[/COLOR][/SIZE][SIZE=2] + missingDllName))[/SIZE]
[SIZE=2]  {[/SIZE]
[SIZE=2]      strTempAssmbPath = gbpvrInstallDir + [/SIZE][SIZE=2][COLOR=#a31515]@"Plugins\common\"[/COLOR][/SIZE][SIZE=2] + missingDllName;[/SIZE]
[SIZE=2]  }[/SIZE]
[SIZE=2][COLOR=#0000ff]  else[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]File[/COLOR][/SIZE][SIZE=2].Exists(gbpvrInstallDir + missingDllName))[/SIZE]
[SIZE=2]  {[/SIZE]
[SIZE=2]      strTempAssmbPath = gbpvrInstallDir + missingDllName;[/SIZE]
[SIZE=2]  }[/SIZE]
[SIZE=2][COLOR=#0000ff]  else[/COLOR][/SIZE]
[SIZE=2][COLOR=#2b91af]      MessageBox[/COLOR][/SIZE][SIZE=2].Show([/SIZE][SIZE=2][COLOR=#a31515]"Unable to locate DLL: "[/COLOR][/SIZE][SIZE=2] + missingDllName, [/SIZE][SIZE=2][COLOR=#a31515]"Missing DLL"[/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#008000]  //Load the assembly from the specified path. [/COLOR][/SIZE]
[SIZE=2]  MyAssembly = [/SIZE][SIZE=2][COLOR=#2b91af]Assembly[/COLOR][/SIZE][SIZE=2].LoadFrom(strTempAssmbPath);[/SIZE]
[SIZE=2][COLOR=#008000]  //Return the loaded assembly.[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]  return[/COLOR][/SIZE][SIZE=2] MyAssembly;[/SIZE]
[SIZE=2]}[/SIZE]
[/SIZE]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,589
Threads: 385
Joined: Dec 2004
#17
2008-01-10, 06:43 PM
JavaWiz Wrote:For your exe, include the following.
Thanks - it works a treat.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with preview image for Pending Recordings Northpole 2 2,051 2012-08-14, 02:56 AM
Last Post: Northpole
  ActivatePopup: SSPlus problem ACTCMS 10 4,900 2012-07-18, 09:43 PM
Last Post: ACTCMS
  Dll assembly referencing mvallevand 5 2,274 2012-03-05, 04:07 AM
Last Post: mvallevand
  Weird Code problem - serialisation (I'll spell it the proper way!!"0 psycik 22 6,375 2011-11-25, 03:16 AM
Last Post: whurlston
  Resolving required plugin assemblies problem McBainUK 37 12,323 2011-10-26, 06:12 PM
Last Post: psycik
  Things missing in npvr alibert 2 1,631 2010-10-09, 10:53 AM
Last Post: alibert
  Problem using UIStatic philcooling 13 4,532 2010-02-12, 06:34 PM
Last Post: whurlston
  IVideoPlugin Problem SummerTimeBlues 9 4,022 2009-07-31, 04:02 AM
Last Post: sgilani
  pvrx2 / plugin assembly resolution bgowland 6 2,434 2009-02-05, 11:14 PM
Last Post: bgowland
  Weather Doppler Radar missing time 4 hours Snooze 0 1,346 2009-02-02, 07:00 PM
Last Post: Snooze

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

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

Linear Mode
Threaded Mode