Rickard Nilsson

  • Blog
  • Archive
  • About
  • Contact
Sign in

Welcome to rickardnilsson.net

rickardnilsson.net is a weblog and the online home of web developer and father of three, Rickard Nilsson... More

Rickard blogs about creating software solutions using ASP.NET and agile practices.

Follow @rickardn

Top Posts

  • Applying stylesheets dynamically with jQuery
  • ASP.NET MVC 2 Framework and Unity 2.0 Dependency Injection Container
  • Code Kata Cast
  • Isolate your code from ASP.NET with Moles Isolation Framework
  • ReSharper User tip #2: Refactor rename namespace
  • Dependency injection in ASP.NET MVC with Unity IoC Container

Categories

  • .NET
  • Agile
  • ASP.NET 2.0
  • ASP.NET 3.5
  • ASP.NET 4
  • ASP.NET MVC
  • BlogEngine.NET
  • C# 2.0
  • C# 3.0
  • C# 4.0
  • Continuous Integration
  • CSS
  • Design by Contract
  • Design Patterns
  • iPhone
  • JavaScript
  • Kata
  • Moles
  • Open source
  • Personal
  • Review
  • Social media
  • Software development
  • TDD
  • Testing
  • Umbraco
  • Unit testing
  • Unity
  • User tip
  • Web development

Five most recent posts

  • C# REPL and Interactive interpreter
  • TDD Kata 2 - Interaction based testing
  • Reflections from day 3 - Umbraco Codegarden 11 in Copenhagen
  • Reflections from day 2 - Umbraco Codegarden 11 in Copenhagen
  • Reflections from day 1 - Umbraco Codegarden 11 in Copenhagen

Tag cloud

  • agile
  • blogengine.net
  • c#
  • code kata
  • codegarden11
  • continuous integration
  • css
  • dependency injection
  • fakes
  • iso 8601
  • javascript
  • jquery
  • refactoring
  • resharper
  • tdd
  • testing
  • umbraco
  • unit test
<< Building a Photo Album widget for BlogEngine.NET | TDD Masterclass in the UK with Roy Osherove >>

ReSharper User tip #2: Refactor rename namespace

Tuesday, 26 August 2008 10:30 by rickard

Have you ever wanted to rename a namespace but you have too many classes in the namespace that it would be an infeasible hassle changing all of them individually. Even using a tool like ReSharper to refactor the namespaces class by class is a hassle. I'm gonna show how to rename a namespace for all of its classes in a couple of key strokes using ReSharper.

Example

Mechanics

  1. Open Class View (Ctrl + Shift + C)
  2. Choose the namespace you want to rename
  3. Press Ctrl + R, R*
    or right-click on the namespace an choose Refactor > Rename
  4. Pick another name
  5. Hit Next

Update! Alternate context menu option to rename namespaces. Tested with ReSharper 5.1.

rsharper_rename_namespace

and you're done!

Please leave a comment if you found this useful.

* Visual Studio scheme

Tags:   resharper, refactoring
Categories:   .NET | User tip
Actions:  

Related posts

ReSharper User tip: Refactor magical strings to variableI've been using Jetbrains ReSharper a while now and I love it. I can't even imagine going back to pl...ReSharper templates from the Code Kata CastAfter I posted my Code Kata Cast I received some feedback regarding the ReSharper templates I use to...The Humble dialog v.2Update! Download source: TheHumbleDialog2.zip (29,96 kb) I've been working to get my head around th...
Comments are closed
 
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© 2008-2011 rickardnilsson.net
Creative Commons-licens