HasAttribute的NDepend(“";System.CodeDom.Compiler.GeneratedCodeAttribute”";.AllowNoMatch())

HasAttribute的NDepend(“";System.CodeDom.Compiler.GeneratedCodeAttribute”";.AllowNoMatch()),ndepend,Ndepend,我有一个修改过的自定义规则,如下所示,我得到了一个查询语法错误,“System.CodeDom.Compiler.GeneratedCodeAttribute”不是有效的类型名。 (对于其他自定义属性,我也得到了相同的错误)。 我试图使用AllowNoMatch()来避免语法错误,但它对我的结果没有影响 另一个属性“System.Diagnostics.DebuggerNonUserCodeAttribute”工作正常 我错过什么了吗 ==============================

我有一个修改过的自定义规则,如下所示,我得到了一个查询语法错误,“System.CodeDom.Compiler.GeneratedCodeAttribute”不是有效的类型名。 (对于其他自定义属性,我也得到了相同的错误)。 我试图使用AllowNoMatch()来避免语法错误,但它对我的结果没有影响

另一个属性“System.Diagnostics.DebuggerNonUserCodeAttribute”工作正常

我错过什么了吗

=============================================================

// <Name>Methods too big (LOC)</Name>
warnif count > 0 from m in JustMyCode.Methods where 
   m.NbLinesOfCode > 30 
   && !m.ParentType.HasAttribute( "System.Diagnostics.DebuggerNonUserCodeAttribute" )
   && !m.ParentType.HasAttribute( "System.CodeDom.Compiler.GeneratedCodeAttribute" )

   orderby m.NbLinesOfCode descending,
       m.NbILInstructions descending
select new { m, m.NbLinesOfCode, m.NbILInstructions }

// Methods where NbLinesOfCode > 30 or NbILInstructions > 200
// are extremely complex and should be split in smaller methods.
// See the definition of the NbLinesOfCode metric here 
// http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
//方法太大(LOC)
JustMyCode中从m开始的warnif计数>0。方法,其中
m、 NbLinesOfCode>30
&& !m、 ParentType.HasAttribute(“System.Diagnostics.DebuggerNonUserCodeAttribute”)
&& !m、 ParentType.HasAttribute(“System.CodeDom.Compiler.GeneratedCodeAttribute”)
orderby m.NbLinesOfCode降序,
m、 降序指令
选择新{m,m.NbLinesOfCode,m.NbILInstructions}
//NbLinesOfCode>30或NBLINInstructions>200的方法
//非常复杂,应采用较小的方法进行分割。
//请参见此处NbLinesOfCode度量的定义
// http://www.ndepend.com/Metrics.aspx#NbLinesOfCode

我发现问题在于包含第三方程序集文件(本例中为System.dll),其中我有两个冲突的System.dll文件。

您能检查一下您的应用程序中是否确实使用了“System.CodeDom.Compiler.GeneratedCodeAttribute”吗,如果在独立类浏览器中,该属性类型显示在第三方装配系统下?