[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2007-10-03
Medium Priority
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

drichards earned 2000 total points
ID: 20010492
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

ID: 20019170
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.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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