Debugging - How to "step into"

Discussion in 'ASP .Net Web Services' started by Gerry, Feb 17, 2010.

  1. Gerry

    Gerry Guest

    Hi there,

    I'm making a call to the following from a standalone ".exe":

    System.Net.WebClient webClient = new WebClient();
    webClient.UploadData("http://localhost//MyPage.aspx", whatever);

    Does anyone know how to trigger a breakpoint in the "Page_load()" method of
    "MyPage.aspx". I want to step into this but nothing I've tried works. Note
    that "Page_Load()" is being called however and breakpoints work if I set
    them when debugging the web app itself. Thank you.
     
    Gerry, Feb 17, 2010
    #1
    1. Advertisements

  2. Gerry

    Andy O'Neill Guest

    The web page is going to be handled by the worker process.
    I have very rarely had to do something where I couldn't just debug the web
    page itself.
    As I recall you use the clr debugger to attach to the worker process.
    A quick google and there seem to be articles on doing this.
     
    Andy O'Neill, Feb 17, 2010
    #2
    1. Advertisements

  3. Gerry

    Gerry Guest

    The web page is going to be handled by the worker process.
    I'll look into this. Thanks for your help.
     
    Gerry, Feb 17, 2010
    #3
  4. Gerry

    Gerry Guest

    System.Net.WebClient webClient = new WebClient();
    Understood but there should be a way to do this. Hardcoding a
    "Debugger.Break()" statement for instance is ignored.
     
    Gerry, Feb 17, 2010
    #4
  5. Gerry

    Jeff Johnson Guest

    What you're not understanding is that the Web site is running completely
    independently of Visual Studio, so it is outside the scope of your debugging
    session. VS doesn't have "tentacles" that reach out to any and every process
    that's accessed by your program and step into them; you'd have to be
    explicitly debugging that other process as well.
     
    Jeff Johnson, Feb 17, 2010
    #5
  6. Gerry

    Gerry Guest

    What you're not understanding is that the Web site is running completely
    I understand this clearly. Putting a "Diagnostics.Debugger.Break()"
    statement in however should invoke the debugger or prompt the user to start
    the debugger (any debugger you want to attach, not necessarily VS). I've now
    got things working by attaching to the ASP.NET process and using a normal
    break point in VS itself. Thanks for everyone's help.
     
    Gerry, Feb 17, 2010
    #6
  7. Gerry

    Patrice Guest

    Understood but there should be a way to do this. Hardcoding a
    What if we restart fresh to understand te whole picture ? It seems to me
    that you are trying to debug a Windows application and that when at some
    point in this app, you hit a Web application you woudl like to be able to
    debug this web application. All this is on your dev box and projects are
    available. Is this correct ?

    Have you tried to launch two instances of VS for each project ? In the web
    app, you have an option to "wait for an external request". Then run your
    Windows project and you'll get control in the other instance when the web
    app is hit.

    Is this what you are looking for ? Else I would suggest coming back at the
    overall goal, sorry but I'm confused by those details and how you would like
    it to work but not sure about your overall goal...
     
    Patrice, Feb 18, 2010
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.