我注意到,一旦我的项目达到一定的大小(在我的情况下~4,100行代码),Visual Studio中的自动完成功能将无法正常工作.我还注意到,一旦第三方库的数量增加(名称空间和类属性和方法不再可见),性能也会降低.
有没有办法手动更新自动完成数据库或为现有项目创建新数据库?
解决方法:
对于VS2015,2017和VS2019关闭Visual Studio并删除与解决方案相同的文件夹中的.vs文件夹.它包含intellisense数据库(如果我们知道哪些文件,应该可以只删除特定于intellisense的文件).请注意,如果删除整个文件夹,您将丢失窗口布局配置等.
对于以前的版本,请关闭Visual Studio并导航到项目文件夹. * .sdf文件包含intellisense数据库 – 如果删除此文件并在visual studio中重新打开项目,它将重建缓存.
删除sdf文件为我解决了问题.
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.
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.
标签:c,windows,visual-studio-2010,visual-studio-2008
来源: https://codeday.me/bug/20190930/1835515.html