From: Jeff Johnson on
"Gerry" <_no_spam@_no_spam.com> wrote in message
news:OFfVWj$rKHA.3800(a)TK2MSFTNGP06.phx.gbl...

>>> 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.
>>
>> Hi, IMO your method is correct (i.e put a breakpoint in the web app) and
>> you can't do otherwise.
>>
>> Technically speaking you just send data to a URL. As this is not an
>> explicit call, it would be quite difficult to have the debugger parsing
>> the url to see this is an ASPX web app, to find out that this is on your
>> localhost and to locate the corresponding solution etc...
>
> Understood but there should be a way to do this. Hardcoding a
> "Debugger.Break()" statement for instance is ignored.

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.


From: Gerry on
> 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.

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.

From: Patrice on
> Understood but there should be a way to do this. Hardcoding a
> "Debugger.Break()" statement for instance is ignored.

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







From: Patrice on
Forgot to mention that the BeginRequest event in your global.asax file could
be a good place for a "break whatever happens" breakpoint...

--
Patrice