Visual Studio - lines being highlighted in yellow while debugging










2















Image



I would like to know how to step into the highlighted yellow area to find out the response of the variable listAgents. When i debug it is just skipping the yellow area and jumping to the next line. Any suggestions?










share|improve this question

















  • 1





    Click to the left of 256 to put a breakpoint on that line.

    – mjwills
    Nov 14 '18 at 5:08











  • You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

    – ps2goat
    Nov 14 '18 at 5:16






  • 3





    You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

    – ps2goat
    Nov 14 '18 at 6:15






  • 3





    The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

    – Hans Kesting
    Nov 14 '18 at 6:29






  • 2





    @R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

    – mjwills
    Nov 14 '18 at 6:44















2















Image



I would like to know how to step into the highlighted yellow area to find out the response of the variable listAgents. When i debug it is just skipping the yellow area and jumping to the next line. Any suggestions?










share|improve this question

















  • 1





    Click to the left of 256 to put a breakpoint on that line.

    – mjwills
    Nov 14 '18 at 5:08











  • You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

    – ps2goat
    Nov 14 '18 at 5:16






  • 3





    You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

    – ps2goat
    Nov 14 '18 at 6:15






  • 3





    The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

    – Hans Kesting
    Nov 14 '18 at 6:29






  • 2





    @R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

    – mjwills
    Nov 14 '18 at 6:44













2












2








2








Image



I would like to know how to step into the highlighted yellow area to find out the response of the variable listAgents. When i debug it is just skipping the yellow area and jumping to the next line. Any suggestions?










share|improve this question














Image



I would like to know how to step into the highlighted yellow area to find out the response of the variable listAgents. When i debug it is just skipping the yellow area and jumping to the next line. Any suggestions?







c# visual-studio






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 5:06









CoderCoder

4011




4011







  • 1





    Click to the left of 256 to put a breakpoint on that line.

    – mjwills
    Nov 14 '18 at 5:08











  • You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

    – ps2goat
    Nov 14 '18 at 5:16






  • 3





    You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

    – ps2goat
    Nov 14 '18 at 6:15






  • 3





    The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

    – Hans Kesting
    Nov 14 '18 at 6:29






  • 2





    @R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

    – mjwills
    Nov 14 '18 at 6:44












  • 1





    Click to the left of 256 to put a breakpoint on that line.

    – mjwills
    Nov 14 '18 at 5:08











  • You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

    – ps2goat
    Nov 14 '18 at 5:16






  • 3





    You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

    – ps2goat
    Nov 14 '18 at 6:15






  • 3





    The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

    – Hans Kesting
    Nov 14 '18 at 6:29






  • 2





    @R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

    – mjwills
    Nov 14 '18 at 6:44







1




1





Click to the left of 256 to put a breakpoint on that line.

– mjwills
Nov 14 '18 at 5:08





Click to the left of 256 to put a breakpoint on that line.

– mjwills
Nov 14 '18 at 5:08













You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

– ps2goat
Nov 14 '18 at 5:16





You'll have to add the breakpoint and cause the event to be fired. Your delegate is an event handler, called when the AgentConnectionUp event fires. Depending on all of your code, you may be adding this event handler after the event fires. If the event only fires once (or not at all), you may never hit your breakpoint.

– ps2goat
Nov 14 '18 at 5:16




3




3





You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

– ps2goat
Nov 14 '18 at 6:15





You already are, the event may just not be firing. You need to add the event handler before the event fires in order to catch it. I don't know how to do that without seeing most of your code, the dependencies, etc.

– ps2goat
Nov 14 '18 at 6:15




3




3





The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

– Hans Kesting
Nov 14 '18 at 6:29





The only thing that line is doing, is to create an eventhandler. This code will only get executed when that event happens

– Hans Kesting
Nov 14 '18 at 6:29




2




2





@R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

– mjwills
Nov 14 '18 at 6:44





@R.Kaushek Think of AgentConnectionUp like a Click event. The code in a Click event handler won't execute unless someone clicks. Similarly, if you aren't hitting a breakpoint inside the delegate it is almost certainly since AgentConnectionUp is not firing.

– mjwills
Nov 14 '18 at 6:44












2 Answers
2






active

oldest

votes


















2














Seems like you are trying to debug an anonymous function. Pressing F10 or F11 will simply jump over the statement as VS does not know when this delegate will be executed.
To debug anonymous methods put a break point inside the function body and invoke the delegate.






share|improve this answer























  • thanks for your reply. what do you mean by an anonymous function?

    – Coder
    Nov 14 '18 at 5:54






  • 1





    This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

    – Farrukh Manzoor
    Nov 14 '18 at 6:14



















1














To jump to the next line use either F10 or F11.



F10 jumps over them,
F11 goes into the methods



EDIT:
in your case: set the breakpoint in the executing block (shortcut for setting a breakpoint: F9)






share|improve this answer























  • That didn't work. unable to step into that area using F10 and F11 keys

    – Coder
    Nov 14 '18 at 5:11











  • did you set a breakpoint at 254 or any line in that block?

    – nnty
    Nov 14 '18 at 5:16












  • yes i tried. but it is not giving the response. anyways thanks for your reply mate.

    – Coder
    Nov 14 '18 at 5:52











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293503%2fvisual-studio-lines-being-highlighted-in-yellow-while-debugging%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Seems like you are trying to debug an anonymous function. Pressing F10 or F11 will simply jump over the statement as VS does not know when this delegate will be executed.
To debug anonymous methods put a break point inside the function body and invoke the delegate.






share|improve this answer























  • thanks for your reply. what do you mean by an anonymous function?

    – Coder
    Nov 14 '18 at 5:54






  • 1





    This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

    – Farrukh Manzoor
    Nov 14 '18 at 6:14
















2














Seems like you are trying to debug an anonymous function. Pressing F10 or F11 will simply jump over the statement as VS does not know when this delegate will be executed.
To debug anonymous methods put a break point inside the function body and invoke the delegate.






share|improve this answer























  • thanks for your reply. what do you mean by an anonymous function?

    – Coder
    Nov 14 '18 at 5:54






  • 1





    This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

    – Farrukh Manzoor
    Nov 14 '18 at 6:14














2












2








2







Seems like you are trying to debug an anonymous function. Pressing F10 or F11 will simply jump over the statement as VS does not know when this delegate will be executed.
To debug anonymous methods put a break point inside the function body and invoke the delegate.






share|improve this answer













Seems like you are trying to debug an anonymous function. Pressing F10 or F11 will simply jump over the statement as VS does not know when this delegate will be executed.
To debug anonymous methods put a break point inside the function body and invoke the delegate.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 5:12









Farrukh ManzoorFarrukh Manzoor

493




493












  • thanks for your reply. what do you mean by an anonymous function?

    – Coder
    Nov 14 '18 at 5:54






  • 1





    This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

    – Farrukh Manzoor
    Nov 14 '18 at 6:14


















  • thanks for your reply. what do you mean by an anonymous function?

    – Coder
    Nov 14 '18 at 5:54






  • 1





    This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

    – Farrukh Manzoor
    Nov 14 '18 at 6:14

















thanks for your reply. what do you mean by an anonymous function?

– Coder
Nov 14 '18 at 5:54





thanks for your reply. what do you mean by an anonymous function?

– Coder
Nov 14 '18 at 5:54




1




1





This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

– Farrukh Manzoor
Nov 14 '18 at 6:14






This MS documentation may help regarding anonymous methods docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…

– Farrukh Manzoor
Nov 14 '18 at 6:14














1














To jump to the next line use either F10 or F11.



F10 jumps over them,
F11 goes into the methods



EDIT:
in your case: set the breakpoint in the executing block (shortcut for setting a breakpoint: F9)






share|improve this answer























  • That didn't work. unable to step into that area using F10 and F11 keys

    – Coder
    Nov 14 '18 at 5:11











  • did you set a breakpoint at 254 or any line in that block?

    – nnty
    Nov 14 '18 at 5:16












  • yes i tried. but it is not giving the response. anyways thanks for your reply mate.

    – Coder
    Nov 14 '18 at 5:52
















1














To jump to the next line use either F10 or F11.



F10 jumps over them,
F11 goes into the methods



EDIT:
in your case: set the breakpoint in the executing block (shortcut for setting a breakpoint: F9)






share|improve this answer























  • That didn't work. unable to step into that area using F10 and F11 keys

    – Coder
    Nov 14 '18 at 5:11











  • did you set a breakpoint at 254 or any line in that block?

    – nnty
    Nov 14 '18 at 5:16












  • yes i tried. but it is not giving the response. anyways thanks for your reply mate.

    – Coder
    Nov 14 '18 at 5:52














1












1








1







To jump to the next line use either F10 or F11.



F10 jumps over them,
F11 goes into the methods



EDIT:
in your case: set the breakpoint in the executing block (shortcut for setting a breakpoint: F9)






share|improve this answer













To jump to the next line use either F10 or F11.



F10 jumps over them,
F11 goes into the methods



EDIT:
in your case: set the breakpoint in the executing block (shortcut for setting a breakpoint: F9)







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 5:07









nntynnty

1467




1467












  • That didn't work. unable to step into that area using F10 and F11 keys

    – Coder
    Nov 14 '18 at 5:11











  • did you set a breakpoint at 254 or any line in that block?

    – nnty
    Nov 14 '18 at 5:16












  • yes i tried. but it is not giving the response. anyways thanks for your reply mate.

    – Coder
    Nov 14 '18 at 5:52


















  • That didn't work. unable to step into that area using F10 and F11 keys

    – Coder
    Nov 14 '18 at 5:11











  • did you set a breakpoint at 254 or any line in that block?

    – nnty
    Nov 14 '18 at 5:16












  • yes i tried. but it is not giving the response. anyways thanks for your reply mate.

    – Coder
    Nov 14 '18 at 5:52

















That didn't work. unable to step into that area using F10 and F11 keys

– Coder
Nov 14 '18 at 5:11





That didn't work. unable to step into that area using F10 and F11 keys

– Coder
Nov 14 '18 at 5:11













did you set a breakpoint at 254 or any line in that block?

– nnty
Nov 14 '18 at 5:16






did you set a breakpoint at 254 or any line in that block?

– nnty
Nov 14 '18 at 5:16














yes i tried. but it is not giving the response. anyways thanks for your reply mate.

– Coder
Nov 14 '18 at 5:52






yes i tried. but it is not giving the response. anyways thanks for your reply mate.

– Coder
Nov 14 '18 at 5:52


















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293503%2fvisual-studio-lines-being-highlighted-in-yellow-while-debugging%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20