LP on .NET

October 11, 2010

Renaming Namespaces

Filed under: .NET,C#,Software Development,Visual Studio — Larry Parker @ 4:04 pm

Did you know that you can use Visual Studio’s refactoring feature to rename namespaces?  Just position the cursor over the portion of the namespace that you want renamed and press F2 (or right-click and select Refactor | Rename), and Visual Studio will rename all occurrences of the namespace in your solution.

For example, from this (place the cursor somewhere over “Server”):

namespace MyApp.Server
    // ...

to this (after renaming to “Client” in the Rename dialog box):

namespace MyApp.Client
    // ...

Pretty handy feature!


1 Comment »

  1. Larry,
    Thanks for that one.
    It is very handy feature, and one I did know existed. But, VS is so big you probably can never know all of the “tricks” and handy features.

    Comment by aussiecraig — October 12, 2010 @ 2:47 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: