C# FX COP无法解析类型引用:System.Windows.Input.ICommand

C# FX COP无法解析类型引用:System.Windows.Input.ICommand,c#,wpf,teamcity,caliburn.micro,fxcop,C#,Wpf,Teamcity,Caliburn.micro,Fxcop,仅在buildagent上和仅通过命令行工具使用FXCOP时出现问题 我正在使用Caliburn.Mirco框架,并添加了一个自定义触发器,这样我就可以使用delete按钮了。此类实现ICommand接口 错误为:“读取模块“MyProject.UI”时遇到以下错误:无法解析类型引用:[System,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]System.Windows.Input.ICommand” 完整的错

仅在buildagent上和仅通过命令行工具使用FXCOP时出现问题

我正在使用Caliburn.Mirco框架,并添加了一个自定义触发器,这样我就可以使用delete按钮了。此类实现ICommand接口

错误为:“读取模块“MyProject.UI”时遇到以下错误:无法解析类型引用:[System,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]System.Windows.Input.ICommand”

完整的错误日志

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="C:\BuildAgent\work\program files\microsoft fxcop 1.36\Xml\FxCopReport.xsl"?>
<FxCopReport Version="10.0">
 <Localized>
  <String Key="Category">Category</String>
  <String Key="Certainty">Certainty</String>
  <String Key="CollapseAll">Collapse All</String>
  <String Key="CheckId">Check Id</String>
  <String Key="Error">Error</String>
  <String Key="Errors">error(s)</String>
  <String Key="ExpandAll">Expand All</String>
  <String Key="Help">Help</String>
  <String Key="Line">Line</String>
  <String Key="Messages">message(s)</String>
  <String Key="LocationNotStoredInPdb">[Location not stored in Pdb]</String>
  <String Key="Project">Project</String>
  <String Key="Resolution">Resolution</String>
  <String Key="Rule">Rule</String>
  <String Key="RuleFile">Rule File</String>
  <String Key="RuleDescription">Rule Description</String>
  <String Key="Source">Source</String>
  <String Key="Status">Status</String>
  <String Key="Target">Target</String>
  <String Key="Warning">Warning</String>
  <String Key="Warnings">warning(s)</String>
  <String Key="ReportTitle">Code Analysis Report</String>
 </Localized>
 <Exceptions>
  <Exception Keyword="CA0001" Kind="Engine">
   <Type>Microsoft.FxCop.Sdk.FxCopException</Type>
   <ExceptionMessage>An unhandled exception was encountered during LoadTargetsForAnalysis:</ExceptionMessage>
   <InnerType>Microsoft.FxCop.Sdk.InvalidMetadataException</InnerType>
   <InnerExceptionMessage>The following error was encountered while reading module 'MyProject.UI': Could not resolve type reference: [System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]System.Windows.Input.ICommand.</InnerExceptionMessage>
   <InnerStackTrace>   at Microsoft.FxCop.Sdk.Reader.HandleError(ModuleNode mod, String errorMessage)
   at Microsoft.FxCop.Sdk.Reader.GetDummyTypeNode(Identifier namesp, Identifier name, ModuleNode declaringModule, TypeNode declaringType, Boolean expectStruct)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromRef(Int32 i, Boolean expectStruct)
   at Microsoft.FxCop.Sdk.Reader.DecodeAndGetTypeDefOrRefOrSpec(Int32 codedIndex)
   at Microsoft.FxCop.Sdk.Reader.GetInterfaces(Int32 i, Int32 firstInterfaceIndex, InterfaceCollection interfaces)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
   at Microsoft.FxCop.Sdk.Reader.GetTypeList(ModuleNode module)
   at Microsoft.FxCop.Sdk.ModuleNode.get_Types()
   at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.LoadTargetsForAnalysis(TargetFileDictionary targetFiles, Int32 loadThreadCount)
   at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.AnalyzeInternal()</InnerStackTrace>
  </Exception>
  <Exception Keyword="CA0001" Kind="Engine">
   <Type>Microsoft.FxCop.Sdk.FxCopException</Type>
   <ExceptionMessage>An unhandled exception was encountered during GlobalBeforeAnalysis:</ExceptionMessage>
   <InnerType>System.NullReferenceException</InnerType>
   <InnerExceptionMessage>Object reference not set to an instance of an object.</InnerExceptionMessage>
   <InnerStackTrace>   at Microsoft.FxCop.Sdk.InternalUtilities.GlobalBeforeAnalysis()
   at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.AnalyzeInternal()</InnerStackTrace>
  </Exception>
 </Exceptions>
</FxCopReport>

类别
确定
全部崩溃
核对身份证
错误
错误
全部展开
帮助
线
信息
[位置未存储在Pdb中]
项目
决议
统治
规则文件
规则描述
来源
地位
目标
警告
警告:
代码分析报告
Microsoft.FxCop.Sdk.FxCopException
LoadTargetsForAnysis期间遇到未处理的异常:
Microsoft.FxCop.Sdk.InvalidMetadataException
读取模块“MyProject.UI”时遇到以下错误:无法解析类型引用:[System,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]System.Windows.Input.ICommand。
位于Microsoft.FxCop.Sdk.Reader.HandleError(ModuleNode mod,String errorMessage)
位于Microsoft.FxCop.Sdk.Reader.GetDummyTypeNode(标识符名称P、标识符名称、ModuleNode declaringModule、TypeNode declaringType、布尔expectStruct)
位于Microsoft.FxCop.Sdk.Reader.GetTypeFromRef(Int32 i,布尔expectStruct)
在Microsoft.FxCop.Sdk.Reader.decodeandGetTypeDeforForSpec(Int32 codedIndex)上
位于Microsoft.FxCop.Sdk.Reader.GetInterfaces(Int32 i、Int32 firstInterfaceIndex、InterfaceCollection interfaces)
位于Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i)
位于Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i)
位于Microsoft.FxCop.Sdk.Reader.GetTypeList(ModuleNode模块)
在Microsoft.FxCop.Sdk.ModuleNode.get_Types()上
在Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.LoadTargetsForAnalysis(TargetFileDictionary targetFiles,Int32 loadThreadCount)中
在Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.AnalyzeInternal()中
Microsoft.FxCop.Sdk.FxCopException
GlobalForeAnalysis期间遇到未处理的异常:
System.NullReferenceException
对象引用未设置为对象的实例。
在Microsoft.FxCop.Sdk.InternalUtilities.GlobalBeforeAnalysis()上
在Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.AnalyzeInternal()中

您是否尝试过将
/gac
作为选项传递?还有
/directory
告诉FxCop从该文件夹加载任何所需的程序集

还有很多选择