Getting current directory

Discussion in 'ASP .Net' started by alberto.decaro@gmail.com, Jun 21, 2005.

  1. Guest

    Hello everybody.
    I'm developing a class library project. I want a method to return the
    path where the compiled .dll file will be placed.
    I try with the Environment.CurrentDirectory property, testing the class

    within an ASP.NET application, but it returns the path of the
    aspnet_wp.exe process (C:\WINDOWS\system32).
    Any clue? Thanks
     
    , Jun 21, 2005
    #1
    1. Advertising

  2. hi,
    try using System.Reflection.Assembly.GetExecutingAssembly().GetName().codeBase
    --
    HTH
    srini
    http://www.expertszone.com


    "" wrote:

    > Hello everybody.
    > I'm developing a class library project. I want a method to return the
    > path where the compiled .dll file will be placed.
    > I try with the Environment.CurrentDirectory property, testing the class
    >
    > within an ASP.NET application, but it returns the path of the
    > aspnet_wp.exe process (C:\WINDOWS\system32).
    > Any clue? Thanks
    >
    >
     
    =?Utf-8?B?c3Jpbmk=?=, Jun 21, 2005
    #2
    1. Advertising

  3. Parag Guest

    try using
    AppDomain.CurrentDomain.BaseDirectory ( returns current directory )

    Regards
    Parag

    <> wrote in message
    news:...
    > Hello everybody.
    > I'm developing a class library project. I want a method to return the
    > path where the compiled .dll file will be placed.
    > I try with the Environment.CurrentDirectory property, testing the class
    >
    > within an ASP.NET application, but it returns the path of the
    > aspnet_wp.exe process (C:\WINDOWS\system32).
    > Any clue? Thanks
    >
     
    Parag, Jun 21, 2005
    #3
  4. Guest

    I thanks a lot both of you. Anyway, according to my app, AppDomain
    works better ;-)
    See you.
     
    , Jun 21, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manu
    Replies:
    1
    Views:
    6,193
    Natty Gur
    Jul 20, 2003
  2. Matthew Heidemann
    Replies:
    14
    Views:
    270
    eT Ma
    Mar 22, 2011
  3. Replies:
    3
    Views:
    193
  4. Adam Petrie
    Replies:
    8
    Views:
    338
    Adam Petrie
    Oct 11, 2004
  5. Jack
    Replies:
    3
    Views:
    672
    Tad J McClellan
    Dec 22, 2008
Loading...

Share This Page