[ASP.NET 2.0] Help with debugging

Discussion in 'ASP .Net' started by James Bailey, Nov 1, 2005.

  1. James Bailey

    James Bailey Guest

    I just converted to ASP.NET 2.0 and VS2005, but I'm having major problems.
    I've gone through all the conversions necessary, but I can't debug my
    applications.

    I have a website designed to run as the root ("/"), but debugging at the
    root level is no longer enabled. I can try to work around this one, but...

    In Application_Start of Global.asax I call:

    string s = this.Context.Server.MapPath("/");

    This line throws an InvalidOperationException. First, why can't I call
    this? And second, how do I get the root path set to a folder?

    Thanks.

    ----
    James Bailey
    James Bailey, Nov 1, 2005
    #1
    1. Advertising

  2. James Bailey

    Scott Allen Guest

    James:

    Is the app running under IIS or under the WebDev server that runs in
    the system tray?

    Have you tried Server.MapPath("~"); ?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Mon, 31 Oct 2005 21:31:42 -0800, "James Bailey" <>
    wrote:

    >I just converted to ASP.NET 2.0 and VS2005, but I'm having major problems.
    >I've gone through all the conversions necessary, but I can't debug my
    >applications.
    >
    >I have a website designed to run as the root ("/"), but debugging at the
    >root level is no longer enabled. I can try to work around this one, but...
    >
    >In Application_Start of Global.asax I call:
    >
    >string s = this.Context.Server.MapPath("/");
    >
    >This line throws an InvalidOperationException. First, why can't I call
    >this? And second, how do I get the root path set to a folder?
    >
    >Thanks.
    >
    >----
    >James Bailey
    >
    Scott Allen, Nov 1, 2005
    #2
    1. Advertising

  3. James Bailey

    James Bailey Guest

    No, but I'm about to test that. However, I think it unlikely to work. For
    example,

    http://localhost/ maps to c:\inetpub\wwwroot
    http://localhost/app/ maps to c:\scripts\app

    In the page http://localhost/app/test.aspx, I want to be able to get the
    root path (i.e. c:\inetpub\wwwroot).

    ----
    James Bailey








    "Scott Allen" <> wrote in message
    news:...
    > James:
    >
    > Is the app running under IIS or under the WebDev server that runs in
    > the system tray?
    >
    > Have you tried Server.MapPath("~"); ?
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Mon, 31 Oct 2005 21:31:42 -0800, "James Bailey" <>
    > wrote:
    >
    >>I just converted to ASP.NET 2.0 and VS2005, but I'm having major problems.
    >>I've gone through all the conversions necessary, but I can't debug my
    >>applications.
    >>
    >>I have a website designed to run as the root ("/"), but debugging at the
    >>root level is no longer enabled. I can try to work around this one,
    >>but...
    >>
    >>In Application_Start of Global.asax I call:
    >>
    >>string s = this.Context.Server.MapPath("/");
    >>
    >>This line throws an InvalidOperationException. First, why can't I call
    >>this? And second, how do I get the root path set to a folder?
    >>
    >>Thanks.
    >>
    >>----
    >>James Bailey
    >>

    >
    James Bailey, Nov 3, 2005
    #3
    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. sean
    Replies:
    1
    Views:
    579
  2. Johann Blake
    Replies:
    1
    Views:
    1,189
    Hermit Dave
    Jan 5, 2004
  3. Jim Bancroft
    Replies:
    1
    Views:
    469
    Scott Allen
    Jan 24, 2005
  4. jacob navia

    Debugging C vs debugging C++

    jacob navia, Oct 26, 2006, in forum: C Programming
    Replies:
    11
    Views:
    578
    Ian Collins
    Oct 27, 2006
  5. AAaron123
    Replies:
    3
    Views:
    648
    AAaron123
    Jul 28, 2009
Loading...

Share This Page