what path corresponds to "root" in a web service?

Posted on 2007-10-03
Last Modified: 2013-12-17
I am trying to position a file in my Visual Studio 2005 development environment for a web service.  And I'd like the file to be addressable just as though the web service were running on my website and the file was located in the root directory.

I've tried in the


but I suspect it needs to be in Inetpub

can anybody help?

Question by:newbieweb
    LVL 19

    Accepted Solution

    What exactly are you trying to do?  There are two types of paths in a web routine virtual and physical.  The Physical path is the path on the OS filesystem (C:\Inetpub\wwwroot\webservice) and the virtual path is the path as configured in the web server (/webservice).  There is a MapPath function to convert the virtual path to a physical path.  If you used the System.IO.Directory.GetCurrentDirectory() method in the web service code it would give you the physical path.  The virtual path is in the request.  The physical path may be in a completely different part of the folder hierarchy or another drive completely from the web server root, depending on how the web site or service was configured in IIS.

    Author Comment

    I learned that I was hitting a stone wall when trying to write a textfile to the root because of the limitations of shared hosting.  I am now upgrading to a virtual dedicated server.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now