Announcement

Collapse
No announcement yet.

How to use specific DLL version with plug-in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use specific DLL version with plug-in

    I am developing a plug-in which references external DLLs. As I have noticed other plug-in writers are using the same DLL, but other versions that I reference I want to avoid a clash.

    Does anyone know of a way I can store my version of the DLL in a specific folder (e.g. \bin\<myplugin|) and then reference that version from my plugin.exe ??
    Nicolai L

  • #2
    An app.config file is what you need and a ProbingPrivatePath to point HS to the new path. I ended up ditching the VS generated one and just using one that I had written in notepad. You can see if this helps you

    Code:
    <?xml version="1.0"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="Bin/CCost3P"/>
        </assemblyBinding>
      </runtime>
    </configuration>
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Thanks, MrHappy! Such a simple solution.
      Nicolai L

      Comment


      • #4
        I'm using this method as well for my plug-ins.
        However version problems can still occurs when a plugin from another author installs a different version of the dll in the HS3 directory. In this case your plugin will use the dll from the HS3 dir instead of bin/<myplugin> even with the app.config

        It happens quite frequently for me, and I wonder if there is a good solution to this issue

        Comment


        • #5
          Originally posted by spud View Post
          I'm using this method as well for my plug-ins.
          However version problems can still occurs when a plugin from another author installs a different version of the dll in the HS3 directory. In this case your plugin will use the dll from the HS3 dir instead of bin/<myplugin> even with the app.config

          It happens quite frequently for me, and I wonder if there is a good solution to this issue
          Hi spud,

          I've manually moved those dll's into a sub-directory under \bin and then created a .config file for the offending plugin. I've also then asked the plugin author to change their plugin to do that by default.

          Cheers
          Al
          HS 3.0.0.548: 1976 Devices 1156 Events
          Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

          Comment


          • #6
            Originally posted by sparkman View Post
            Hi spud,

            I've manually moved those dll's into a sub-directory under \bin and then created a .config file for the offending plugin. I've also then asked the plugin author to change their plugin to do that by default.

            Cheers
            Al
            yeah this is a good workaround, but I'm wondering if there is a way in the app.config to tell the plugin exe to look for dependencies first in bin/<myplugin> and then in the HS3 dir, this would avoid the problem completely.

            Comment


            • #7
              Originally posted by spud View Post
              yeah this is a good workaround, but I'm wondering if there is a way in the app.config to tell the plugin exe to look for dependencies first in bin/<myplugin> and then in the HS3 dir, this would avoid the problem completely.
              I think there's a way to specify the exact version # of the dll you need. That way, if the one in the root directory is not the right one, it will keep looking for the correct one. More details are here: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx.

              Cheers
              Al
              HS 3.0.0.548: 1976 Devices 1156 Events
              Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

              Comment

              Working...
              X