Search Wiki:
This post contains custom rule implementation in FxCop.
The purpose of this Custom rule to check for code correctness in terms of following the naming convention standard for the variables defined for all the types as well as controls used in the application.
For example integer should be prefixed with "int", Textbox should be prefixed with "txt".
Last edited Jun 6 2007 at 3:34 AM  by amitmnagarwal503, version 1
Venki wrote  Apr 29 2008 at 5:39 AM  
Hello Amit
I think the code submitted by you rips the first character irrespective of whether it is underscore or any other character. I think it is because of the below code in the ControlNamingConvention Class.

private void CheckStandard(string strVariableType, string strVariableName, string strVariableStd)
if (!strVariableName.StartsWith("_" + strVariableStd))
base.get_Problems().Add(new Problem(base.GetResolution(new string[] { strVariableType, strVariableName.Remove(0, 1), strVariableStd }), strVariableName));

Page view tracker