|
Back
Preparing file x for Refactoring Problem When Refactoring in Visual Studio 2005
If you have tried the refactoring functionality of Visual Studio 2005, for example if you want to do a quick encapsulation of a field in your class, you might find yourself a bit disappointed with the new features. Certainly this was a feature I was initially looking forward to using.
In order to perform the refactoring, Visual Studio 2005 goes through all the project files, then it runs through all the aspx pages, then it runs through all assemblies, then it runs through files again to apply the change. This probably means that by the time it is done it would probably have been quicker in alot of cases for you to make the necessary changes manually. Even with a small web project it can take an age.
Refactorings should be much faster in almost every type of project except for web projects. This is unfortunately due to the asynchronous nature of web projects where Visual Studio does not know what their contents are since they might be located on some web site half way across the world. When you invoke a refactoring, Visual Studio then needs to pull down all the web site contents and compile them to see if there are any references to the item you are refactoring.
If you take a look at the following page Microsoft are stating that they were unable to change the behaviour for this release of Visual Studio and are hoping to address it in futures releases. They are looking to see if there are ways that they can improve on web refactorings in the future so that it can bring them more in line with normal refactorings
Their current solution for speeding up the refactoring process is for you to open up each and every page in your web project and then run the refactoring process. Certainly that is not a great workaround (and no substitute for having refactoring working correctly) but it may improve the refactoring performance significantly. Personally I am going to avoid refactoring and wait for the next update.
Back
|