views:

306

answers:

3

Hello All

Similar to the way Resharper makes copying or moving a type to another file and adjust all of your using statements, I'd love to be able to refactor a VS project, and know all of my references, assembly names, and file locations will be properly adjusted.

Does Resharper or any other tools make project level refactoring easy?

Thanks, Berryl

A: 

I'm not sure you'll get everything you want, but there is a lot there. You can do three things with Resharper that help with this:

1) On a project or solution level, you can right click on it in Visual Studio and select "Cleanup Code..." which will reformat all your files in that project and change using statements, etc.

2) You can right click on each dependency within a project and select "Find Usages..." to make sure a dependency is needed.

3) There are some new features with Resharper recently where you can right click on the project and say "Find Dependent Code" for code in other projects and assemblies that the selected project uses, and "Find Referenced Code" for code that references the code in the selected project.

Michael Hedgpeth
Berryl
+1  A: 

Version 4.5 of ReSharper can now point out even public members that are not accessed by any code in the solution. It does not remove them for you, but can highlight them so that you can do so yourself. This does assume that you have all the code that matters within the solution. I believe it can also tell you that a particular public member can be made internal, but I haven't actually seen it do so yet (I've only just upgraded).

John Saunders
Favorite new feature, because someone before my time thought making hundreds of methods "public static" in a 92-project solution would be a grand idea.
Chris Doggett
A: 

About file locations - next version of ReSharper will track file moving and renaming and adjust all it's references. It's useful for ASP.NET projects - Masterpage, User Controls, JS, CSS, Images references.

derigel
will it update the version control system as well?
Ian Ringrose
Sure, but this feature was postponed.
derigel

related questions