Announcement

Collapse
No announcement yet.

How to load referenced dll via exe.config ?

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

  • How to load referenced dll via exe.config ?

    Hi,

    I'm trying to use NewtonSoft.Json in my plugin.

    Everything is working code-wise. The dll is also deployed to bin\HSPI_SurveillanceStation, however my app is unable to load the dll.

    If I put it in the same directory as the executable, it works.

    my exe.config looks like this:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <startup>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="bin/HSPI_SurveillanceStation"/>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
            <codeBase version="8.0.0.0" href="bin/HSPI_SurveillanceStation/Newtonsoft.Json.dll"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
      </startup>
    </configuration>
    What am I overlooking here ?

  • #2
    I have to be honest I had a hells game with this and getting it to work with similar symptoms, for whatever reason I had to manually create the exe.config file to use rather than using the one created by VS. You could try similar, this is all I have in mine;

    Code:
    <?xml version="1.0"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="Bin/CCost3P;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, but that doesn't do the trick for me :-(

      EDIT:

      fixed, I had the startup runtime tag IN the startup tag.

      Comment

      Working...
      X