我正在做C#的项目。现在我已经设置了一个哈德逊服务器,并且已经在服务器上安装了.Net 4框架和Windows SDK7.1。
项目成功构建,但当我启动FxCop时:
"C:\Program Files (x86)\Microsoft FxCop 1.35\fxcopcmd.exe" /file:CommonServiceTool\bin\Release /out:fxcop-result.xml它会加载所有.dll规则文件,之后会发生以下异常:
Using system files at: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319.
Could not resolve reference to PresentationFramework.
Could not resolve reference to PresentationCore.
Could not resolve reference to WindowsBase.
12 exceptions occurred while loading Project1.
00) Could not resolve type reference: [PresentationFramework]System.Windows.StartupEventArgs.
01) Could not resolve type reference: [PresentationFramework]System.Windows.Window.
02) Could not resolve type reference: [PresentationFramework]System.Windows.Controls.HeaderedContentControl.
03) Could not resolve type reference: [PresentationCore]System.Windows.Input.ICommand.
04) Could not resolve member reference: System.Windows.ThemeInfoAttribute::.ctor.
... and so on...我在项目中使用WPF,我认为FxCop找不到WPF库。有人能帮我这个忙吗?
发布于 2012-09-05 14:50:39
确保项目->选项...-检查拼写和分析-> "Search Global Assembly Cache for missing references“(根据FxCop and GAC Madness)。
发布于 2012-09-06 03:11:46
您是直接运行fxcopcmd.exe,还是通过插件运行?如果是前者,请尝试添加/gac命令行开关。如果您使用的是中间跑步器,那么它是什么?
发布于 2014-07-21 15:34:25
我在使用fxcopcmd V12时遇到了类似的问题。我可以通过显式地添加
/reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll"请参阅:FxCop engine exception on WPF assembly
https://stackoverflow.com/questions/12275570
复制相似问题