Setting path of the root directory in C# class library

Last post 07-03-2008 12:51 AM by vinay.a. 2 replies.

Sort Posts:

  • Setting path of the root directory in C# class library

    07-02-2008, 5:26 AM
    • Loading...
    • vinay.a
    • Joined on 03-28-2008, 5:44 AM
    • Bangalore
    • Posts 13

     hi,

    I am doing a project, which includes:

    ASP.NET website (User Interface)
    C# class library (Business Layer)

    All I am doing is, trying to load an XML file into the business layer at run time and use its contents.

    The file will be stored in the root directory of my ASP.NET website, as I will be using only dlls of my class library.
    We can use "HttpContext.Current.Server.MapPath("Filename")" for mapping files to the User Interface requests.
    Mean while, is there any thing similar to the "HttpContext" while the request is made by the class library.

    Regards,

    vinay

  • Re: Setting path of the root directory in C# class library

    07-02-2008, 7:41 AM
    Answer
    • Loading...
    • Jeev
    • Joined on 11-24-2005, 7:49 AM
    • Posts 3,109

    vinay.a:
    is there any thing similar to the "HttpContext" while the request is made by the class library
      -No however you can either pass the path to the class library class via the  constructor or a property and your UI could set the path

    Jeev
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If you get the answer to your question, please mark it as the answer.
  • Re: Setting path of the root directory in C# class library

    07-03-2008, 12:51 AM
    Answer
    • Loading...
    • vinay.a
    • Joined on 03-28-2008, 5:44 AM
    • Bangalore
    • Posts 13

    Thanks for your reply Yes. I was doing the same sending the absolute path from the UI in to the Class library after resolving the relative path of root directory.

    regards,
    vinay

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter