5 Replies - 954 Views - Last Post: 12 March 2011 - 01:13 AM Rate Topic: -----

#1 zedth2  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 14-September 09

Access DLL in SubDirectory

Posted 11 March 2011 - 03:02 PM

What I'm looking to do is access a DLL in a subdirtory. So instead of doing this

\debug\App.exe
\debug\lib.dll

I want to do this,

\debug\App.exe
\debug\resources\lib.dll

I don't really want to use the assembly namespace, I'd prefer to be able to add the reference and just change the file path to

Forms.Application.StartupPath & "\resoucres\lib.dll"



Anyone know how to do this?
Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Access DLL in SubDirectory

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 956
  • View blog
  • Posts: 3,676
  • Joined: 02-July 08

Re: Access DLL in SubDirectory

Posted 11 March 2011 - 04:39 PM

Look into this.
Was This Post Helpful? 0
  • +
  • -

#3 zedth2  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 14-September 09

Re: Access DLL in SubDirectory

Posted 11 March 2011 - 04:44 PM

Thanks thats looking like the best option, I'm also looking into the probing element for the app.config but can't quite figure it out.
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 956
  • View blog
  • Posts: 3,676
  • Joined: 02-July 08

Re: Access DLL in SubDirectory

Posted 11 March 2011 - 05:43 PM

<runtime>
 <assemblyBinding>
  <dependentAssembly>
    <assemblyIdentity name="Lib" publicKeyToken="f0b5026b59d5645e"   
     culture="neutral" />
  </dependentAssembly>
  <probing privatePath="resource"/>
 </assemblyBinding>
</runtime>


Was This Post Helpful? 1
  • +
  • -

#5 zedth2  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 14-September 09

Re: Access DLL in SubDirectory

Posted 11 March 2011 - 07:34 PM

YES You are the man, I'll give it a shoot after I figure out all the little pieces.
Was This Post Helpful? 0
  • +
  • -

#6 zedth2  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 14-September 09

Re: Access DLL in SubDirectory

Posted 12 March 2011 - 01:13 AM

Ok, after spending most of the night digging through more fourms and looking over countless MSDN articles I finally got it to work. The .config xml file has to be in the same directory as the EXE. But the code I ended up using in the config file is slightly different.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="root\etc"/>
    </assemblyBinding>
  </runtime>



Its very simple and I'm sure theres a better way if I was to combine this with hawkvalley1's post from earlier but this works for now.

One last question though, I'd like to make the config file an embedded resource but it doesn't appear to like that, is there any way to do that. I just don't want the user to see it. All that should happen is
User: hey look an EXE I can click this.

Without having to see all the extra non-sense that makes it work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1