Command Line Complier + Subdirectory DLL Not Working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goblinsleez
    New Member
    • Oct 2008
    • 3

    Command Line Complier + Subdirectory DLL Not Working

    Ok , heres the thing. I have a project im workin on, and i have my exe , in a directory, with a subdirectory named DLL and inside that my dll.

    I was sure that

    csc /t:winexe /lib:DLL /r:uiobj.dll msf_exe.cs

    is the compiler command i would use to create my exe, set up a DLL subdirectory and reference the dll inside it...

    But alas when i run the exe and JiT Debugger error somes up saying System.IO.FileN otFound exception.... even though the command compiler does not have any error compiling the code.

    It doesnt matter what i do , if i dont have my dll inside the folder with the exe it wont work. I can even add my dll to the GAC with gacutil.exe and that works fine. I just cant access my private dll's inside my subdirectory. Could it be that my environment vars are set wrong , or something else. i was sure that /:lib set a directory reference , but its just not working for me /cry :(

    Any help or ideas would be great, thanks you in advance!
  • SvenV
    New Member
    • Oct 2008
    • 50

    #2
    Try to specify the complete path in the lib switch, f.e.
    csc /t:winexe /lib:C:\MyApp\DL L /r:uiobj.dll msf_exe.cs

    Comment

    • goblinsleez
      New Member
      • Oct 2008
      • 3

      #3
      Damn , im went two days fighting with this, and i have the answer to my question. I have never come across the need to use a Config file before , but it is the solution to all problems. If you are like me and want your project to maintain some form of organization, you will probably not want oodles of dll's inside your main app directory. This is easily achieved with a config file. You can create your application config file with notepad. EG:

      Assuming that you wish to use a directory structure siliar to this :

      Application Folder
      --> app.exe
      --> app.exe.config
      -->Folder DLL
      Folder DLL --> your_dll1.dll
      Folder DLL --> your_dll2.dll
      Folder DLL --> your_dll3.dll


      Open up notepad and and add this ....

      configuration>
      <runtime>
      <assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
      <probing privatePath="DL L"/>
      </assemblyBinding >
      </runtime>
      </configuration>

      Now save it as UTF-8 and name it as seen here ...
      application-name.exe.config where <application-name> is the name of your application.

      Thanks for help.
      Until next time , bye.

      Comment

      Working...