Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Debugging - How to "step into"

Reply
Thread Tools

Debugging - How to "step into"

 
 
Gerry
Guest
Posts: n/a
 
      02-17-2010
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.

 
Reply With Quote
 
 
 
 
Andy O'Neill
Guest
Posts: n/a
 
      02-17-2010

"Gerry" <_no_spam@_no_spam.com> wrote in message
news:%23BfUrT$(E-Mail Removed)...
> 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.

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.

 
Reply With Quote
 
 
 
 
Gerry
Guest
Posts: n/a
 
      02-17-2010
> 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.


I'll look into this. Thanks for your help.

 
Reply With Quote
 
Gerry
Guest
Posts: n/a
 
      02-17-2010
>> 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.

 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      02-17-2010
"Gerry" <_no_spam@_no_spam.com> wrote in message
news:OFfVWj$(E-Mail Removed)...

>>> 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.


 
Reply With Quote
 
Gerry
Guest
Posts: n/a
 
      02-17-2010
> 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.

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      02-18-2010
> 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







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How can I skip debugging Ajax when debugging my code? AAaron123 ASP .Net 3 07-28-2009 04:07 PM
Debugging C vs debugging C++ jacob navia C Programming 11 10-27-2006 07:19 PM
No Debugging of C# Server-Side Script, but Code-Behind Debugging Works Johann Blake ASP .Net 1 01-05-2004 03:01 PM
Garbage Collector Debugging Rob Tillie ASP .Net 11 08-18-2003 10:39 PM



Advertisments