Derreck Dean
Derreck Dean

Reputation: 3766

Refactoring (Rename) in VS2010 screws up WinForms project

I rename variables local to a specific function, or even variables local to a class, but the built in rename refactoring goes and fixes everything project-wide. I renamed a variable called "d" to "deposits" and it changed every occurrence of "d" in the project, and the only way I noticed it was because date formatting was messed up on a form I hadn't even touched. Besides getting Resharper or another refactoring tool, is there a way to fix VS's refactoring? I did not have the refactoring tools give me trouble on a Silverlight project.

Upvotes: 0

Views: 186

Answers (2)

Osiris
Osiris

Reputation: 499

Make sure you uncheck the "Search in comments" check box when you use this tool. Sometimes the rename command is a bit overzealous updating the comments.

It is unclear from your description, did your rename command erroneously rename unrelated variables with the same name in other classes?

Upvotes: 1

Ryan Amies
Ryan Amies

Reputation: 4922

This is not standard Visual Studio functionality, ensure you have no extensions that could be causing this. Also try to reinstall VS.

Upvotes: 1

Related Questions