Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Reference dlls in sub folders

Reference dlls in sub folders

Scheduled Pinned Locked Moved Visual Basic
sysadmin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nlarson11
    wrote on last edited by
    #1

    Hello, Can someone tell me how i can tell my exe to look into sub folders if the dll being referenced isn't in the folder the exe is. I found the server config code but it doesn't work in the exe config. Thank you. Nathan

    'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

    S 1 Reply Last reply
    0
    • N nlarson11

      Hello, Can someone tell me how i can tell my exe to look into sub folders if the dll being referenced isn't in the folder the exe is. I found the server config code but it doesn't work in the exe config. Thank you. Nathan

      'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

      S Offline
      S Offline
      sri_0099
      wrote on last edited by
      #2

      Nathan, Use System.AppDomain.CurrentDomain.BaseDirectory to get root directory where EXE is. from rootdirectory you can fetch directories inside root directory. Regards, Sr

      N 1 Reply Last reply
      0
      • S sri_0099

        Nathan, Use System.AppDomain.CurrentDomain.BaseDirectory to get root directory where EXE is. from rootdirectory you can fetch directories inside root directory. Regards, Sr

        N Offline
        N Offline
        nlarson11
        wrote on last edited by
        #3

        Thanks Sr...that doesn't work with references I have several apps that reference dlls that have controls in them. Typically those same dlls would be in the same folder as the exe. Because of "cluttering up" the main folder i wanted to move the dlls and their supporting files into a sub folder. I want the exe to look local and then go through sub folder(s) to look there as well before it comes back and tells me "file not found". There is a config setting that you can give to make it do that on the server. I just need to know what is the config setting to do that for the exe. Thank you...

        'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

        D 1 Reply Last reply
        0
        • N nlarson11

          Thanks Sr...that doesn't work with references I have several apps that reference dlls that have controls in them. Typically those same dlls would be in the same folder as the exe. Because of "cluttering up" the main folder i wanted to move the dlls and their supporting files into a sub folder. I want the exe to look local and then go through sub folder(s) to look there as well before it comes back and tells me "file not found". There is a config setting that you can give to make it do that on the server. I just need to know what is the config setting to do that for the exe. Thank you...

          'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

          D Offline
          D Offline
          DaveAuld
          wrote on last edited by
          #4

          I amnot familiar with this type of operations but looking at the MSDN documentation; AppDomainSetup class contains a method PrivateBinPath which states; Gets or sets the list of directories under the application base directory that are probed for private assemblies. Don't know if that will help or not!

          Dave Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

          N 1 Reply Last reply
          0
          • D DaveAuld

            I amnot familiar with this type of operations but looking at the MSDN documentation; AppDomainSetup class contains a method PrivateBinPath which states; Gets or sets the list of directories under the application base directory that are probed for private assemblies. Don't know if that will help or not!

            Dave Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

            N Offline
            N Offline
            nlarson11
            wrote on last edited by
            #5

            Thank you Dave...your privatepath gave me the right thing to lookup. If you add this to your exe config, it will look in sub folders as well as the base directory for files that you are referencing. In the example below, I want the exe to also prob sub folder controls. <configuration>    <runtime>       <asemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">          <probing privatePath="controls"/>       </assemblyBinding>    </runtime> . . . </configuration>

            'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups