Announcement

Collapse
No announcement yet.

Putting referenced assemblies in a subdirectory?

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

  • Putting referenced assemblies in a subdirectory?

    Hi, I'm currently writing my first plugin and it will have a couple of referenced assemblies. I wanted to play nice and put them in a subdirectory with a unique name so that it doesn't conflict with other plugins potentially using different versions of the same assembly. (I have to admit I don't know if there will be namespace collisions here).

    I tried adding a callback to AppDomain.CurrentDomain.AssemblyResolve but it's never called before HomeSeer declares that the assembly can't be found on startup. I also tried adding my custom path to App.config but that didn't seem to work either.

    Any ideas?

    Thanks!

  • #2
    here is how I do it, I put all my referenced assemblies in bin/plugin_name

    then in my app.config, I add the probing line like below:

    Code:
    <?xml version="1.0"?>
    <configuration>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
      <runtime>
        <loadFromRemoteSources enabled="true"/>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="bin/plugin_name"/>
        </assemblyBinding>
      </runtime>
    </configuration>

    Comment


    • #3
      I was able to make that work. Thanks!

      Comment

      Working...
      X