2
다음은 내 사용자 정의 규칙 어셈블리 및 embeded xml 리소스 파일입니다. 내 어셈블리 이름과 기본 네임 스페이스 이름은 모두 MyRules입니다. 나는 왜 이렇게 사용자 정의 fxcop 규칙을 추가하기가 어려울 수 있는지 파악할 수 없다. 나는 항상 "규칙을 선택하지 않았습니다"오류가 발생했습니다. 나는 사용자 정의 FxCop 규칙을 추가하는 방법은 무엇입니까?
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</Url>
<Resolution>My Resolution</Resolution>
<MessageLevel Certainty="95"></MessageLevel>
<Email></Email>
<FixCategories>NoBreaking</FixCategories>
<Owner>Bill</Owner>
</Rule>
</Rules>