gpt4 book ai didi

c# - "Warning CS1684: Reference to type X claims it is defined in .. but it could not be found"

转载 作者:太空狗 更新时间:2023-10-29 17:58:14 25 4
gpt4 key购买 nike

我在构建我们称为 PWTests 的测试项目时收到此警告。

Warning CS1684: Reference to type 'System.Windows.Input.ICommand' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll', but it could not be found

这个项目应该测试我们称之为 PW 的类库。我无法确定为什么它认为 System.Windows.Input.ICommand 是在 System.dll 中定义的。在测试项目和类库项目中正确引用了实际定义 ICommand 的 PresentationCore。我尝试删除对 PresentationCore 的引用,清理并重新添加它(如其他问题中所述),但没有用。

我如何确定是什么导致它认为 ICommand 在 System.dll 中?

最佳答案

我们确实需要更多信息,但这是我解决这个问题的方法。

往往是当你通过 nuget 或类似的东西添加了一些东西时,如果你查看你的 app.config 你会看到一些重定向(可能)检查 ICommand 所在的程序集(通常在你的垃圾箱中文件夹或直接引用)并确保版本在其中对齐。

如果您发布您的 app.config 并说明您正在使用的程序集,这会有所帮助,这样我就可以更加准确。

关于c# - "Warning CS1684: Reference to type X claims it is defined in .. but it could not be found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24767535/

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