tags:

views:

30

answers:

1

Below are my custom rule assembly and embeded xml resources file. My assembly name and the default namespace name are both MyRules. I just cannot figure out why it could be SO SO difficult to add a custom fxcop rule? I always got the "no rules were selected" error. I am going crazy...

using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.FxCop.Sdk;

namespace MyRules
{
    public class MyRule1 : BaseIntrospectionRule
    {
        public MyRule1() :
            base("MyRule1", "MyRules.TutorialRules",
          typeof(MyRule1).Assembly)
        {
        }
    }
}

<?xml version="1.0" encoding="utf-8"?>
<Rules FriendlyName="My Rules Friendly Name">
  <Rule TypeName="MyRule1" Category="My Category" CheckId="SM0001">
    <Name>My Name</Name>
    <Description>My Desciription</Description>
    <Url>http://www.google.com.in&lt;/Url&gt;
    <Resolution>My Resolution</Resolution>
    <MessageLevel Certainty="95"></MessageLevel>
    <Email></Email>
    <FixCategories>NoBreaking</FixCategories>
    <Owner>Bill</Owner>
  </Rule>
</Rules>
A: 

Problem solved.

It turns out that I Miss the inner text of MessageLevel.

smwikipedia