首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FxCop在命令行抛出异常,而不是在图形用户界面中?

FxCop在命令行抛出异常,而不是在图形用户界面中?
EN

Stack Overflow用户
提问于 2011-09-15 22:09:28
回答 2查看 975关注 0票数 1

我有一个通过FxCop图形用户界面运行良好的FxCop 10.0项目,但当我通过FxCopCmd命令行应用程序(我想将其用作自动构建过程的一部分)运行它时,它会生成以下异常-显然是在试图加载程序集时。

代码语言:javascript
复制
  <Exception Keyword="CA0001" Kind="Engine">
   <Type>System.InvalidOperationException</Type>
   <ExceptionMessage>Collection was modified; enumeration operation may not execute </ExceptionMessage>
   <StackTrace>   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at Microsoft.FxCop.Sdk.WeakAssemblyReference.FindMatchingReference(WeakAssemblyReference faRef, AssemblyReferenceCollection references, Hashtable cache)
   at Microsoft.FxCop.Sdk.WeakAssemblyReference.Initialize()
   at Microsoft.FxCop.Sdk.FrameworkAssemblies.GetFrameworkAssemblyReference(WeakAssemblyReference&amp; assemblyRef, String assemblyName)
   at Microsoft.FxCop.Sdk.FrameworkAssemblies.get_SystemCore()
   at Microsoft.FxCop.Sdk.FrameworkTypes.get_DynamicAttribute()
   at Microsoft.FxCop.Sdk.INodeWrappers.CCIParameterWrapper.get_DynamicTypes()
   at Microsoft.FxCop.Sdk.INodeWrappers.CCIParameterWrapper.get_Type()
   at Microsoft.FxCop.Sdk.NameProviders.NameProvider.WriteCommaSeparatedParameters(INodeCollection`1 parameters)
   at Microsoft.FxCop.Sdk.NameProviders.NameProvider.WriteMethodParameters(IMethodNode method)
   at Microsoft.FxCop.Sdk.NameProviders.NameProvider.WriteMethod(IMethodNode method)
   at Microsoft.FxCop.Sdk.NameProviders.CodeWriter.WriteCore(INode node)
   at Microsoft.FxCop.Sdk.NameProviders.NameProvider.WriteCore(INode node)
   at Microsoft.FxCop.Sdk.NameProviders.NameProvider.GetName(INode node)
   at Microsoft.FxCop.Engines.Introspection.Persistence.GetName(Node node, NameStyle style)
   at Microsoft.FxCop.Engines.Introspection.BaseVisitor.FindTargetMember(Member member, TargetMemberDictionary targets)
   at Microsoft.FxCop.Engines.Introspection.LoadVisitor.FindTargetMember(Member member, TargetMemberDictionary targets)
   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)</StackTrace>
  </Exception>

我在谷歌上找不到任何有启发性的东西,所以有谁知道这可能是什么原因吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-09-20 15:55:34

这是因为试图在10.0文件上运行FxCop 1.36。我们的单元测试代码试图在两个不同的文件夹中查找FxCop,但我只更新了其中的一个:(

票数 1
EN

Stack Overflow用户

发布于 2011-09-20 02:29:59

您是否使用相同的.fxcop项目文件来运行UI和命令行?如果没有,您是否在FxCop UI设置中禁用了多线程加载?

如果您不确定,最好的办法是尝试在命令行运行中使用禁用多线程加载的.fxcop项目文件。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7432226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档