Results 1 to 5 of 5

Thread: [RESOLVED] how to get application path in a dll?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2010
    Posts
    213

    Resolved [RESOLVED] how to get application path in a dll?

    So I made myself a class library in .net. I plan on making this .dll do some checks on the application that declares it and uses it. How do I get, say, application.executablepath in the dll?

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: how to get application path in a dll?

    This is part of the System.Reflection namespace and should work for you:

    vb.net Code:
    1. Assembly.GetExecutingAssembly().Location

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2010
    Posts
    213

    Re: how to get application path in a dll?

    Thank you very much!

    And just one more thing:

    I want to use this dll in my main program. How do I declare it and use its functions?

  4. #4
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: how to get application path in a dll?

    You will have to add a reference to it in your project. Here is how you can do it, you will navigate to the Browse tab and then find your .dll.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2010
    Posts
    213

    Re: how to get application path in a dll?

    Oh ok thanks! I forgot that if my dll is a .NET class library then I can simply use it like a class and use its functions etc easily. It's not one of those other .dlls where you have to reference it and declare each function and whatnot. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width