为什么Visual Studio需要这么长时间才能删除文件

时间:2021-08-03 22:53:10

Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity.

为什么Visual Studio需要这么长时间才能从解决方案树中删除文件?该应用程序冻结并坐在那里感觉像永恒。

If I delete the file from the file system first, then delete it in the solution it happens instantly.

如果我首先从文件系统中删除该文件,然后在解决方案中将其删除,它会立即发生。

Is there an option I can set somewhere to avoid this?

我可以设置一个选项以避免这种情况吗?

6 个解决方案

#1


18  

I've found that when there is a lot in my Recycle Bin (1000s of files), it takes longer to delete a file in Windows Explorer as well as Visual Studio.

我发现当我的回收站(1000个文件)中有很多内容时,在Windows资源管理器和Visual Studio中删除文件需要更长的时间。

#2


3  

I've found that this is sometimes a symptom of project size. Deleting a file from a project with hundreds of files can take 30 seconds on my (admittedly slow) work computer. But deleting one of two files in a project is usually instant.

我发现这有时是项目规模的一个症状。从包含数百个文件的项目中删除文件可能需要30秒才能在我的(通常很慢)工作计算机上运行。但是删除项目中的两个文件之一通常是即时的。

#3


2  

Do you have a version control plugin with Visual Studio? It may be contacting a server to make sure you can check it out...

你有Visual Studio的版本控制插件吗?它可能正在联系服务器以确保您可以检查出来...

If not, where is the file located? Is it a local file or on the network? Sometimes if on the network, VS has to check if you have windows access to delete the file.

如果没有,文件位于何处?它是本地文件还是网络?有时如果在网络上,VS必须检查你是否有Windows访问权限来删除文件。

#4


1  

Do you have Resharper installed? Once I installed it, it definitely slowed down file operations on my machine. Worth the tradeoff, I think.

你有Resharper安装?一旦我安装它,它肯定减慢了我的机器上的文件操作。我认为值得权衡。

#5


1  

it could be rebuilding/removing from the intellisense database or checking the rest of the project for validity once the file is deleted. Or it could just be that the new VSs are buggy.

它可能是从intellisense数据库重建/删除,或者在删除文件后检查项目的其余部分是否有效。或者它可能只是新的VSs有缺陷。

#6


0  

It may be normal if your project size is very big. We are talking about a 50-200 projects solution.

如果您的项目规模非常大,这可能是正常的。我们正在讨论50-200项目解决方案。

If you have R# installed on your PC try to disable it or try to delete your project items with an empty recycle bin.

如果您的PC上安装了R#,请尝试禁用它或尝试使用空的回收站删除项目项目。

Altough I do not recommend it, you can try to delete all the *.opt and *.ncb files from all your project directories and bring Visual Studio up again.

我不推荐它,您可以尝试从所有项目目录中删除所有* .opt和* .ncb文件,并再次启动Visual Studio。

#1


18  

I've found that when there is a lot in my Recycle Bin (1000s of files), it takes longer to delete a file in Windows Explorer as well as Visual Studio.

我发现当我的回收站(1000个文件)中有很多内容时,在Windows资源管理器和Visual Studio中删除文件需要更长的时间。

#2


3  

I've found that this is sometimes a symptom of project size. Deleting a file from a project with hundreds of files can take 30 seconds on my (admittedly slow) work computer. But deleting one of two files in a project is usually instant.

我发现这有时是项目规模的一个症状。从包含数百个文件的项目中删除文件可能需要30秒才能在我的(通常很慢)工作计算机上运行。但是删除项目中的两个文件之一通常是即时的。

#3


2  

Do you have a version control plugin with Visual Studio? It may be contacting a server to make sure you can check it out...

你有Visual Studio的版本控制插件吗?它可能正在联系服务器以确保您可以检查出来...

If not, where is the file located? Is it a local file or on the network? Sometimes if on the network, VS has to check if you have windows access to delete the file.

如果没有,文件位于何处?它是本地文件还是网络?有时如果在网络上,VS必须检查你是否有Windows访问权限来删除文件。

#4


1  

Do you have Resharper installed? Once I installed it, it definitely slowed down file operations on my machine. Worth the tradeoff, I think.

你有Resharper安装?一旦我安装它,它肯定减慢了我的机器上的文件操作。我认为值得权衡。

#5


1  

it could be rebuilding/removing from the intellisense database or checking the rest of the project for validity once the file is deleted. Or it could just be that the new VSs are buggy.

它可能是从intellisense数据库重建/删除,或者在删除文件后检查项目的其余部分是否有效。或者它可能只是新的VSs有缺陷。

#6


0  

It may be normal if your project size is very big. We are talking about a 50-200 projects solution.

如果您的项目规模非常大,这可能是正常的。我们正在讨论50-200项目解决方案。

If you have R# installed on your PC try to disable it or try to delete your project items with an empty recycle bin.

如果您的PC上安装了R#,请尝试禁用它或尝试使用空的回收站删除项目项目。

Altough I do not recommend it, you can try to delete all the *.opt and *.ncb files from all your project directories and bring Visual Studio up again.

我不推荐它,您可以尝试从所有项目目录中删除所有* .opt和* .ncb文件,并再次启动Visual Studio。