i created a cutom rules. when i applied that rule in fxcop . it shows error as no rules are selected.
that tells NamingConstants are not found in DLADesignRules.xml
please tell solution for that.
public class NamingConstants:BaseIntrospectionRule
{
// Second argument is the name of the resource stream: XML file. The resource file // is (dll_name).(xml_file_name). public NamingConstants(): base(@"NamingConstants", "DLADesignRules.DLADesignRules" , typeof(NamingConstants).Assembly){
// // TODO: Add constructor logic here //}
public override ProblemCollection Check (Member memberField )
{
Field mField = memberField as Field; if (mField == null){
return null;}
if (mField.IsStatic && !mField.IsInitOnly && mField.IsLiteral){
if (Regex.IsMatch(mField.Name.Name, @"[^A-Z_]")){
Resolution resolution = base.GetResolution(mField.Name.Name); Problem problem = new Problem(resolution, mField.Name.Name); base.Problems.Add(problem);}
}
return base.Problems;}
}

problem in creating custom rules.
edralph
Your rules XML is likely not wired up properly between your compiled assembly and rule code. Do this:
Launch FxCop
Add your compiled custom rule as a target.
Expand the rule in the UI until you open its 'Resources' node
Make sure your rule XML is named correctly. According to your rule source code, it should be named 'DLADesignRules.DLADesignRules'. If it isn't, change your compilation settings to fix the problem, or alter your rule source to refer to it correctly (do not add the '.xml' extension in your rule source. In VS, the 'default namespace' setting will influence the fully-qualified name an embedded XML resource will be emitted to.
If the XML name looks correct, click on it. Examine the FxCop output pane to insure that a node for 'NamingConstants' can be located.