We usually catch exception in the upper level of a code like the GUI (forms).
But I usually have this kind of code
try
{
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
MessageBox.Show("Application has encountered error....");
}
I could just catch(Exception) without the identifier because I do not need the message on runtime, but for the debugging build, it sure is convenient to break at the catch statement. So I usually write a Console.WriteLine to prevent a lot of warning of unused ex variable. I have a lot of case of Console.WriteLine(ex.Message) in my code. Does this cost performance decrease?
Note: Changed title from "Does Console.WriteLine(ex.Message) have performance cost?" to "Calling Console.WriteLine(ex.Message) to prevent warning message"