1
我正在嘗試爲fxcop開發自定義規則。使用fxcop無法看到我的自定義規則
我有這樣的代碼:
namespace TestCustomRuleFxCop
{
public class DoTheRightThingRule : BaseIntrospectionRule
{
public DoTheRightThingRule()
: base("DoTheRightThing", "TestCustomRuleFxCop.Rules",
typeof(DoTheRightThingRule).Assembly)
{
}
public override ProblemCollection Check(Member member)
{
return null; // todo
}
}
}
我有這個XML(文件名爲rules.xml並設置生成操作嵌入的ressource)
<?xml version="1.0" encoding="utf-8" ?>
<Rules FriendlyName="My rules">
<Rule TypeName="DoTheRightThingRule" Category="MyCategory" CheckId="MyId">
<Name>My rule name</Name>
<Description>My description</Description>
<Resolution>Add Resolution</Resolution>
<Email></Email>
<MessageLevel Certainty="100">Warning</MessageLevel>
<FixCategories>Breaking</FixCategories>
</Rule>
</Rules>
我編譯,運行的FxCop並添加規則與此DLL。
我可以看到「我的規則」的文件夾,但它沒有規則......
我在想什麼?
感謝您的幫助, 最好的問候
感謝您的幫助,重新創建項目後,它正在工作... 最好的問候 – Tim 2009-11-17 13:43:53