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

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

问题描述

我们当前正在评估新的Visual Studio 2015,并且遇到了IntelliSense的奇怪问题.当我使用新的Studio编译主要解决方案时,构建成功,但是显示了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>

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

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天全站免登陆