Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
In the code below:

C#
catch (Exception ex)
{
    MessageBox.Show(string.Format("Msg = {0}; StackTrace = {1)", ex.Message, ex.StackTrace));
    request.Abort();
    return null;
}


..."ex.StackTrace" is grayed out. Why?
Posted
Comments
ZurdoDev 12-Mar-14 19:27pm    
What does that even mean, it's grayed out?
B. Clay Shannon 12-Mar-14 19:28pm    
"Greyed out" means that, in Visual Studio, the text in question is grey, indicating that it's superfluous (it compiles, but it's unnecessary/redundant/a no-op).
ZurdoDev 12-Mar-14 19:32pm    
I have no idea. I have never seen that. You must have some option turned on that I don't. Does it work?
B. Clay Shannon 12-Mar-14 19:48pm    
I don't know - that exception is not being thrown.
MinHongKwu 12-Mar-14 20:29pm    
Maybe "grayed out " means stopping running program ..
you check include Exception class or inherit concern class ..

1 solution

The problem here is an infestation by a demon. That demon caused you to forget to put a matching close-curly-brace on the second place-holder in your formatted string:
C#
MessageBox.Show(string.Format("Msg = {0}; StackTrace = {1})", ex.Message, ex.StackTrace));
 
Share this answer
 
Comments
george4986 13-Mar-14 1:56am    
+5v nice explanation

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900