A
aioe.cjb.net
So, I was planning on ridding my VS2005 solution of all warnings, but the
ones sounding "The variable 'ex' is declared but never used" in
catch-blocks, are causing a headache.
I have several cases of code like this:
try
{
// Some code
}
catch (Exception ex)
{
LogTool.Log("Error deserializing XML reference tag.");
// I don't care what ex is
}
There is no way i can create a catch block without declaring the ex
variable, right? So what do I do when I want the catch block, don't want to
use the variable, don't want the warning, and don't want to change the
warning level in VS2005?
I could possibly do some dummy operation on ex. Any suggestion? (Then
again... What's worse - Having dummy code overhead in the actual application
or warnings clogging the compialtion log.)
Regards,
Frode Nilsen
ones sounding "The variable 'ex' is declared but never used" in
catch-blocks, are causing a headache.
I have several cases of code like this:
try
{
// Some code
}
catch (Exception ex)
{
LogTool.Log("Error deserializing XML reference tag.");
// I don't care what ex is
}
There is no way i can create a catch block without declaring the ex
variable, right? So what do I do when I want the catch block, don't want to
use the variable, don't want the warning, and don't want to change the
warning level in VS2005?
I could possibly do some dummy operation on ex. Any suggestion? (Then
again... What's worse - Having dummy code overhead in the actual application
or warnings clogging the compialtion log.)
Regards,
Frode Nilsen