Last Updated on January 30, 2021 by sandeeppote

[code language=”csharp”]
catch (OutOfMemoryException ex)
{
Log.Error("Error")
}
[/code]
Severity Code Description Project File Line Suppression State
Error CS0168 The variable ‘ex’ is declared but never used

To suppress this code remove variable and simply write catch block like this-
[code language=”csharp”]
catch (OutOfMemoryException)
{
Log.Error("Error")
}
[/code]