Visual Studio 2015 或 2017 显示 IntelliSense 错误,但解决方案可编译 [英] Visual Studio 2015 or 2017 shows IntelliSense errors but solution compiles

查看:38
本文介绍了Visual Studio 2015 或 2017 显示 IntelliSense 错误,但解决方案可编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在评估新的 Visual Studio 2015,并在 IntelliSense 方面遇到了一个奇怪的问题.当我用新工作室编译我们的主要解决方案时,构建成功,但仍然显示 6 个错误.

We are currently evaluating the new Visual Studio 2015 and encountered a strange problem with IntelliSense. When I compiled our main solution with the new studio the build succeeds, but nevertheless 6 errors are shown.

我发现这不是真正的错误,而只是智能感知错误.代码绝对正确,一切都编译成功.然而,代码被标记为红色,错误显示在错误列表中.

I discovered that it's not a real error, but only an intellisense error. The code is definitely correct and everything compiled successfully. The code however is marked red and errors show up in the error list.

所有 6 个错误都具有相同的起源.这是一个简单的构造函数调用.很奇怪,但也有一些完全相同的构造函数没有任何错误.

All 6 errors have the same origin. It's a simple constructor call. Strange enough, but there are also some occurrences of the exact same constructor without any errors.

错误信息:

Code: CS1729
Message: '<the class>' does not contain a constructor that takes that many arguments.
Project: <the project name>
File: <the path to the file>

新工作室安装在新安装的 Windows 7 上,没有任何旧版软件(没有 VS13).

The new studio was installed on a freshly installed Windows 7 without any legacy software (no VS13).

我已经尝试清除缓存、删除 suo 文件、删除 bin 和 obj 目录、清理并重建解决方案等.但没有任何效果.

I've already tried to clear the caches, deleted the suo file, deleted bin and obj directories, cleaned and rebuilt the solution etc. But nothing worked.

谁能向我解释这种行为?

Can anyone explain that behavior to me?

推荐答案

迁移的项目也有这个问题,所以我参考了 Microsoft.CSharp dll.在某些项目中,我需要删除并重新添加项目中的引用.

Also had this problem with a migrated project, so I referenced the Microsoft.CSharp dll. In some projects I needed to remove and add again the Reference in the project.

这篇关于Visual Studio 2015 或 2017 显示 IntelliSense 错误,但解决方案可编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆