首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FxCop无法解析引用

FxCop无法解析引用
EN

Stack Overflow用户
提问于 2012-09-05 14:23:04
回答 4查看 7.7K关注 0票数 5

我正在做C#的项目。现在我已经设置了一个哈德逊服务器,并且已经在服务器上安装了.Net 4框架和Windows SDK7.1。

项目成功构建,但当我启动FxCop时:

代码语言:javascript
复制
"C:\Program Files (x86)\Microsoft FxCop 1.35\fxcopcmd.exe" /file:CommonServiceTool\bin\Release /out:fxcop-result.xml

它会加载所有.dll规则文件,之后会发生以下异常:

代码语言:javascript
复制
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库。有人能帮我这个忙吗?

EN

回答 4

Stack Overflow用户

发布于 2012-09-05 14:50:39

确保项目->选项...-检查拼写和分析-> "Search Global Assembly Cache for missing references“(根据FxCop and GAC Madness)。

票数 4
EN

Stack Overflow用户

发布于 2012-09-06 03:11:46

您是直接运行fxcopcmd.exe,还是通过插件运行?如果是前者,请尝试添加/gac命令行开关。如果您使用的是中间跑步器,那么它是什么?

票数 4
EN

Stack Overflow用户

发布于 2014-07-21 15:34:25

我在使用fxcopcmd V12时遇到了类似的问题。我可以通过显式地添加

代码语言:javascript
复制
/reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll"

请参阅:FxCop engine exception on WPF assembly

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

https://stackoverflow.com/questions/12275570

复制
相关文章

相似问题

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