I have a medium-sized solution with 99 projects that has recently started behaving weirdly:

1) If I try to rename a file through the solution explorer, VS will seemingly hang, but after a long time (10+ minutes) it will complete the rename operation.

2) I also noticed today that switching to between Debug and Release mode seems to freeze VS as well. So far I haven't let it run long enough to see if that actually completes.

I've tried both Visual Studio 2012 and 2013, and both exhibit the same problem, so that seems to indicate the problem might not be with Visual Studio. I've tried to check in the event log if there's anything there, but nothing jumped out on me. I've also rebooted and run checkdisk, but it didn't find anything wrong.

Running Windows 7 Professional on a fairly high-specced laptop with 8GB RAM and a new SSD

Update: apparently if I have renamed a file once, I can keep renaming it (and other files in the solution) immediately. When I restart VS, it's slow again.

Update2: I left the computer running overnight to try to switch from Debug to Release, and it managed to do so in the 14ish hours between me leaving work and getting back here.

  • Are you using Team Foundation Server? Are you using server workspaces in TFS? – Edward Thomson Mar 10 '14 at 16:11
  • We're using TFS for some other solutions, but this one uses Git. – Petter Brodin Mar 10 '14 at 16:16
  • 1
    Interesting; what about Resharper? – Edward Thomson Mar 10 '14 at 16:18
  • One of my colleagues (who has it working) uses it, but I haven't installed it yet. – Petter Brodin Mar 10 '14 at 16:19
  • 2
    I have the same problem with only ONE project inside my solution. Renaming takes 1-2 minutes. Ridiculous, visual studio 2015! – TetraDev Jun 3 '16 at 17:34

Visual Studio can be extremely slow in renaming files if you are using TFS with a "local" workspace as oppose to a "server" workspace, and the total number of files including different versions in the TFS repository exceeds 10,000 items.

Contrary to Microsoft's recommendation, I suggest using a server workspace instead of a local one for much better performance. There are also some other downsides to local workspaces and the only upside is being able to work while your TFS repository is down. That's not much of an upside considering if you can't connect to TFS, you probably can't connect to your LAN and there's darn little work you can do anyway in that situation.

To change to a server workspace for TFS in Visual Studio 2015,

  1. In VS click on File --> Source Control --> Advanced --> Workspaces

  2. In the dialog that opens, select your workspace and click Edit...

  3. Click Advanced... (it does not matter which mapping is selected).

  4. Under Location, select Server and then press OK.

Switching over to server may take ten minutes or more depending on the size of your repository.

Once this is done, renaming files should be nearly instantaneous.

  • We use local workspaces for other reasons here (i.e. because that's what the boss wants). I see your point above and I give you upvote for the insight into WHY it takes so long, but not everyone can just change their workspace type. – Jerry May 4 '17 at 14:47
  • 1
    BLESS you my son! This worked.. Renaming/moving was taking 1-2 minutes every time. This brought it down to 5-10 seconds. Still too slow for me, but I can live with it. Many sincere thanks! Works in 2017. – Michael K May 8 '17 at 23:04
  • We have some teams working in other countries who VPN into our server to connect to TFS. I'm afraid to try this for our scenario as I'm pretty sure it wouldn't end well :(. Really disappointed in Microsoft on this – BVernon Jan 14 '18 at 0:42
  • Perfect, this works!...I was losing my mind (maybe lost it already). – CodingYoshi Jan 31 at 21:41
  • While this works, note that this also means that you can only edit files from within Visual Studio now. For example, Excel now cannot save a file since all files are now read-only. Hopefully we can just migrate to git soon... – Didii Jun 13 at 8:37

When testing I'd made an attempt at setting up one of the projects to build on a different server, both in Debug and Release mode. I though I'd cleaned up both, but apparently I'd only done so under the Debug configuration.

Apparently meanwhile that server has decided it hates my machine, which makes my machine freeze while waiting for it.

Closing Visual Studio and manually editing the .csproj file solved the problem.


Unfortunately 99 projects is not a medium sized solution for Visual Studio but instead a very large solution. Visual Studio simply doesn't scale well to solutions of this size and you're seeing the effects of that here.

The only way to make this better is to factor out your solution into several smaller solutions.

  • 1
    Even so, how should renaming a file that's referenced less than 10 times take more than 10 minutes? None of the other developers working on the same solution experience the same thing. – Petter Brodin Mar 10 '14 at 15:53
  • @PetterBrodin it's honestly hard to say without profiling. There are a number of reasons why Visual Studio can be slow (other extensions, cached data, small tweaks in setup, FS issues). Without profiling it's hard to say what could be going on here and I'm left with speculation. my first guess is the file rename is triggering a semantic class rename and that rename across 99 projects is causing a slowdown – JaredPar Mar 10 '14 at 15:55
  • By "Semantic class rename", do you mean the dialogue that pops up and says "You are renaming a file. Would you also like to perform a rename in this project of all references to the code element [Class name]"? That dialogue doesn't show up until after 10ish minutes, and when I click "no", it completes the rename seemingly immediately. – Petter Brodin Mar 10 '14 at 16:45
  • @PetterBrodin that means that it's most likely taking 10ish minutes to calculate if a semantic rename is possible (checks that before the dialog). – JaredPar Mar 10 '14 at 17:01
  • Any idea what could be causing it? Apparently I can switch between Debug and Release as well, it just takes a REALLY long time. – Petter Brodin Mar 11 '14 at 7:51

Building on @Daniel Barbalace's answer, my issue indeed had to do with TFS, but I could not switch to server workspaces. What I ended up doing was removing the mappings to any branches or projects that I am not working on at the moment. There is no magic number but once I seemed to get under 50,000 files (globally for the TFS folder) renaming suddenly went down from 2+ minutes to 3-5 seconds.

Your Answer

