FxCop metrics.exe失败,解析IL时出错

时间:2015-11-12 18:49:43

标签: msbuild visual-studio-2015 fxcop

使用visual studio 2015中的MSBuild。

针对已编译的程序集运行metrics.exe。

以下例外情况正在被抛出。

任何有关如何解决问题的建议都将不胜感激。

这是在我将一个内部类'StandardFactory'添加到类'BaseClass'

之后开始的

我假设IL与2015年有所不同。

此致

詹姆斯

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

An error was encountered while parsing IL for method: 'BaseClass`1+StandardFactory`1+<InitAsync>d__2.MoveNext', instruction at offset '0x17' with opcode 'Ldfld'.
   at Microsoft.FxCop.Sdk.ILParser.GetMemberFromToken()
   at Microsoft.FxCop.Sdk.InstructionParser.ParseInstruction()
   at Microsoft.FxCop.Sdk.InstructionParser.ParseInstructions()
   at Microsoft.FxCop.Sdk.Reader.ParseMethodInstructions(Method method, Int32 methodIndex, Int32 RVA)
   at Microsoft.FxCop.Sdk.Reader.GetMethodInstructions(Method method, Object i)
   at Microsoft.FxCop.Sdk.Reader.GetMethodBody(Method method, Object i, Boolean asInstructionList)
   at Microsoft.FxCop.Sdk.Method.get_Instructions()
   at Microsoft.FxCop.Sdk.RuleUtilities.HasImperativeSecurityAction(Method method, SecurityAction action)
   at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction action)
   at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction[] actions)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.RecordCallSites(Method caller)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitMember(Member member, TargetMember target)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitType(TypeNode type, TargetType target)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitTypes(TypeNodeCollection types, TargetNamespaceDictionary targets)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitModule(ModuleNode module, TargetModule target)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.Load(TargetFile target, Boolean buildTree, Boolean queueItems, AssemblyNode loadedAssembly)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.LoadAssemblies(Queue queue, ExceptionCollection exceptions)
Analyzing...
An error was encountered while parsing IL for method: 'BaseClass`1+StandardFactory`1.InitAsync(System.String)', instruction at offset '0x8' with opcode 'Stfld'.
   at Microsoft.FxCop.Sdk.ILParser.GetMemberFromToken()
   at Microsoft.FxCop.Sdk.InstructionParser.ParseInstruction()
   at Microsoft.FxCop.Sdk.InstructionParser.ParseInstructions()
   at Microsoft.FxCop.Sdk.Reader.ParseMethodInstructions(Method method, Int32 methodIndex, Int32 RVA)
   at Microsoft.FxCop.Sdk.Reader.GetMethodInstructions(Method method, Object i)
   at Microsoft.FxCop.Sdk.Reader.GetMethodBody(Method method, Object i, Boolean asInstructionList)
   at Microsoft.FxCop.Sdk.Method.get_Instructions()
   at Microsoft.FxCop.Sdk.AnonymousMethodTable.GetAnonymousMethodsRecursivelyFromInstructions(Method declaringMethod, Set`1 results)
   at Microsoft.FxCop.Sdk.MethodMetrics..ctor(Method method, Predicate`1 couplingFilter)
   at Microsoft.FxCop.Sdk.TypeMetrics..ctor(TypeNode type, Predicate`1 filter, Predicate`1 couplingFilter)
   at Microsoft.FxCop.Sdk.BaseMetrics.GetMetricsFor(Node node, Predicate`1 filter, Predicate`1 couplingFilter)
   at Microsoft.FxCop.Rules.Maintainability.AvoidUnmaintainableCode.Check(TypeNode type)
   at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.CheckType(TypeNode type, TargetType target)

0 个答案:

没有答案