Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
790 views
in Technique[技术] by (71.8m points)

visual-studio - Visual Studio 2015或2017显示IntelliSense错误,但解决方案已编译(Visual Studio 2015 or 2017 shows IntelliSense errors but solution compiles)

We are currently evaluating the new Visual Studio 2015 and encountered a strange problem with IntelliSense.

(我们目前正在评估新的Visual Studio 2015,并遇到了IntelliSense的奇怪问题。)

When I compiled our main solution with the new studio the build succeeds, but nevertheless 6 errors are shown.

(当我用新工作室编译主要解决方案时,构建成功,但是显示了6个错误。)

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.

(但是,该代码标记为红色,并且错误显示在错误列表中。)

All 6 errors have the same origin.

(所有6个错误的起因均相同。)

It's a simple constructor call.

(这是一个简单的构造函数调用。)

Strange enough, but there are also some occurrences of the exact same constructor without any errors.

(足够奇怪,但是也有一些完全相同的构造函数出现而没有任何错误。)

The error message:

(错误信息:)

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>

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

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

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.

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

Can anyone explain that behavior to me?

(谁能向我解释这种行为?)

  ask by Ash translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had thousands of intellisense errors and 0 build errors.

(我有成千上万的智能错误和0生成错误。)

After deleting .suo file and restarting VS intellisense errors are gone.

(删除.suo文件并重新启动VS后, .suo错误消失了。)

Suo file is located relatively to source in: .vs\SolutionName\v14\.suo

(Suo文件相对于源文件位于: .vs\SolutionName\v14\.suo)

According to comment: Beware that *.suo is a hidden file.

(根据评论:注意*.suo是隐藏文件。)

Edit: According to comments, VS2017 has the same issue, so you can use similar solution: Delete .

(编辑:根据评论,VS2017具有相同的问题,因此您可以使用类似的解决方案:Delete。) vs\SolutionName\v15\.suo


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...