CS.BANNED.CONSOLE_WRITE
Avoid System.Console 'Write()' or 'WriteLine()' statements.
Disallows the use of 'System.Console.WriteLine()' or 'System.Console.Write()' for debugging purposes. Methods to be excluded from this rule: by default, "Main", "Show", "Verbose".
Mitigation and prevention
Debugging statements should be cleaned up before the product is released.
Vulnerable code example
1 namespace examples.rules.misc 2 { 3 public class SIO 4 { 5 public void Method1() 6 { 7 System.Console.WriteLine("result is : " + "result"); // VIOLATION 8 //... 9 } 10 } 11 }
Deleting line 7 will resolve the issue.