Stefan Monov
Stefan Monov

Reputation: 11732

Inter-solution C# refactoring in VS

I have solution A which defines public class Foo, and solution B which references A and uses Foo. I rename Foo to Bar in A and use the "Update References" feature, but that only updates the references in the current solution. How do I go about updating them in solution B as well (automatically)?

(note that search&replace isn't an option, because it doesn't take context into account - there may be other symbols called Foo too)

Upvotes: 0

Views: 122

Answers (3)

driis
driis

Reputation: 164291

I have had this same problem, and what I did was to create a "master" solution including all of the affected projects; and doing my refactoring in that (using ReSharper). It worked very well.

I think you need to take the same approach - after all, how could a tool guess that you have other solutions lying around that referencing the same project and needs to be refactored ?

Upvotes: 1

Grokys
Grokys

Reputation: 16526

I don't think there's any way to do this in VS, there might be something in an add-on like Resharper though (I've never used it).

Could you temporarily add all of the projects to a single solution, and link them using Project References? That would allow all of the references to Foo to be renamed.

Upvotes: 0

Matthias
Matthias

Reputation: 12259

You could use ReSharper for that job.

Upvotes: 0

Related Questions