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.
External guidance
Vulnerable code example
Copy
namespace examples.rules.misc
{
public class SIO
{
public void Method1()
{
System.Console.WriteLine("result is : " + "result"); // VIOLATION
//...
}
}
}
Deleting line 7 will resolve the issue.