Rick Strahl's Weblog
Rick Strahl's FoxPro and Web Connection Weblog
White Papers | Products | Message Board | News |

Speeding up slow Control Renaming in Visual Studio


October 08, 2007 •

Ever curse the fact that if you rename a control in the visual designer in Visual Studio, that it's dreadfully slow? This is VS.NET trying to be overly helpful and trying to refactor the new name throughout your project. As you rename the VS.NET Refactor window pops up as it's churning through open files to refactor the name through the whole project. This is mildly useful if you're working in .NET, but when working with Web Connection it does absolutely nothing for you.

The issue occurs when renaming a control on which you have set any properties already - if you create a new control and immediately rename it this refactoring doesn't take place. But if you do make changes to properties first and then rename, you get this annoying delay.

Luckily there's a registry hack that lets you get around this issue and get immediate name changes to controls. This from an older post from Scott Guthrie:

To apply this registry setting:

  1. Close all running instances of VS 2005
  2. Click Start->Run in Windows and run "regedit"
  3. Navigate to this registry location: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\CSharp\Options\Editor
  4. Right-click on the Editor node and choose "New DWORD value"
  5. Name the value "OpenAllVenusFilesOnRefactor" and leave the value as 0

Then, when you restart VS 2005 and perform a re-factoring - you should find performance very fast.

This hack basically turns off the refactoring functionality beyond the current page and so it's pretty fast. It looks like this has been fixed in Visual Studio 2008 thankfully.

Posted in:

Feedback for this Weblog Entry