在Visual Studio中刷新自动完成(IntelliSense)数据库 [英] Refreshing the auto complete (IntelliSense) database in Visual Studio

查看:421
本文介绍了在Visual Studio中刷新自动完成(IntelliSense)数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到 Visual Studio 中的自动完成功能一旦我的项目已达到一定的大小(在我的情况下为约4,100行代码)。我还注意到,一旦第三方库的数量增加(名称空间,类属性和方法不再可见),性能也会下降。

I've noticed that the auto complete feature in Visual Studio no longer works properly once my project has reached a certain size (in my case ~4,100 lines of code). I've also noticed that performance also degrades once the number of third-party libraries increases (namespaces and class attributes and methods are no longer visible).

有没有办法手动更新自动完成数据库或为现有项目创建新数据库的方法?

Is there a way of manually updating the auto completion database or create a new one for an existing project?

我目前在 Visual Studio 2008 ,但我在 Visual  Studio  2010

推荐答案

对于VS2015、2017和VS2019关闭Visual Studio并删除与解决方案相同的文件夹中的.vs文件夹。它除其他外还包含智能感知数据库(如果我们知道哪些文件,则应该仅删除特定于智能感知的文件)。请注意,如果删除整个文件夹,则会丢失窗口布局配置等。

For VS2015, 2017 and VS2019 close Visual Studio and delete the .vs folder in the same folder as the solution. It contains among other things the intellisense database (it should be possible to delete only the files specific to intellisense, if we knew which ones). Note that if you delete the whole folder you will lose your window layout configurations etc.

对于以前的版本,请关闭Visual Studio并导航到项目文件夹。那里的* .sdf文件包含智能感知数据库-如果删除此文件并在Visual Studio中重新打开项目,它将重建缓存。

For previous versions, close Visual Studio and navigate to your project folder. The *.sdf file there contains the intellisense database- if you delete this files and reopen your project in visual studio, it rebuilds the cache.

删除sdf文件解决了对我来说是个问题。

Deleting the sdf file solved the problem for me.


有时使用大型解决方案(主要是C ++项目)会变得难以忍受。要解决此问题,您需要关闭解决方案,然后
删除.SDF文件。之后,它会恢复正常,大约每周
a,直到您需要再次执行。

Sometimes working with a big solution (mainly C++ projects) becomes unbearably slow. To fix it you need to close the solution and go delete the .SDF file. After that it returns to normal again, for about a week, or so until you need to do it again.

根本原因是SDF文件碎片化,根据我完成的xperf分析,
在调试和发行版之间切换时,VS有时会从中进行20,000+
次随机读取。将
SDF文件放在SSD上可以解决此问题,但不是必须的。
VS永远需要更有效地使用SDF文件,而不要阻止SDF
操作。

The underlying cause is that the SDF file gets fragmented and, according to xperf profiling I've done, VS will sometimes do 20,000+ random reads from it when changing between debug and release. Putting the SDF files on an SSD fixes the problem but should not be necessary. VS needs to use the SDF file more efficiently and not do blocking SDF operations, ever.

源: https:// visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2255455-fix-the-delete-sdf-file-problem

这篇关于在Visual Studio中刷新自动完成(IntelliSense)数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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