找不到类型或命名空间名称 'ContractClassFor'(是否缺少 using 指令或程序集引用?)

The type or namespace name 'ContractClassFor' could not be found (are you missing a using directive or an assembly reference?)

我正在使用以下代码。

[ContractClassFor(typeof(IWindow))]

为什么会出现错误"The type or namespace name 'ContractClassFor' could not be found (are you missing a using directive or an assembly reference?)"?

这是由于歧义问题而发生的。我从参考中删除了 Microsoft.Contracts。现在它工作正常。感谢 Mr.Frebin 弗朗西斯的支持。