Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8071033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:34:21+00:00 2026-06-05T13:34:21+00:00

So I have a web project, and I’m trying to get the root directory

  • 0

So I have a web project, and I’m trying to get the root directory of the website using the c# method Directory.GetCurrentDirectory(). I don’t want to be using a static path as the file locations will be changing in the future. This method is running in my imageProcess.aspx.cs file, but where I thought it would return:

C:\Users\tcbl\documents\visual studio 2010\Projects\ModelMonitoring\ModelMonitoring\imageProcess.aspx.cs

I’m instead getting:

C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\

Can anyone explain why this is happening and what a possible solution might be? Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:34:23+00:00Added an answer on June 5, 2026 at 1:34 pm

    The current directory is a system-level feature; it returns the directory that the server was launched from. It has nothing to do with the website.

    You want HttpRuntime.AppDomainAppPath.

    If you’re in an HTTP request, you can also call Server.MapPath("~/Whatever").

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one web application with two projects: Project Website Using CMS; namespace Web
I have a web project with devexpress component ASPxGridView. So I want to know
I have developed a web project. Which is generating log file using log4j. But
I have a web project in eclipse using glassfish. I have the following datasource
I have a web project that I want to version in SVN. SVN is
Anybody who have a web project in maven with spring? I don't know why
I have a web project using asp.net mvc3. Now clients ask for a security
I have a web project called TestResourceApp with Labels.resx in App_GlobalResources folder. I want
I have j2ee web project in IntelliJ IDEA with complex web resource directory structure
I have an intranet web project that is currently using the IEWC tabstrip and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.