Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Green Exceptions?

When unhandled exceptions are encountered in VStudio usually the debugger highlights the line YELLOW as the line that threw the exception.

However sometimes I encounter exceptions where the debugger highlights them green as shown:

enter image description here

I've always treated them as normal exceptions, but today I decided to ask since google/bing produced no results for "Visual Studio Green Exceptions"

like image 724
Aren Avatar asked May 11 '10 22:05

Aren


2 Answers

The line is highlighted yellow if that is the line that directly threw the exception (typically a throw statement).
It's green if the line is a call to a different function that threw the exception (typically a call to a .Net function that threw an exception).

like image 177
SLaks Avatar answered Oct 14 '22 10:10

SLaks


The yellow line is the line where the exception is really thrown.

The green line indicates a line that is indirectly affected.

I think the screenshot makes it clear. Note that I had to use the "Callstack" window and switch to the Main() method in order to achieve this effect.

Green and yellow exception in Visual Studio

like image 6
Thomas Weller Avatar answered Oct 14 '22 09:10

Thomas Weller