gpt4 book ai didi

c# - FxCop 无法解析引用

转载 作者:太空狗 更新时间:2023-10-29 22:33:24 25 4
gpt4 key购买 nike

我正在使用 C# 开发项目。现在我已经设置了一个 Hudson 服务器我已经在服务器上安装了 .Net 4 Framework 和 Windows SDK 7.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 库。有人可以帮我解决这个问题吗?

最佳答案

确保项目 -> 选项... - 拼写和分析 -> “搜索全局程序集缓存中缺少的引用”被选中(根据 FxCop and GAC Madness)。

关于c# - FxCop 无法解析引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12275570/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com