0

I had a collection of classes and forms that I have since re-organised into folders. I thought I should rename the namespaces to match the folder structure, but now I have a whole heap of errors like

The name 'xyz' does not exist in the current context.

What is the proper process to rename a namespace in Visual Studio (2010)

Ben
  • 2,433
  • 5
  • 39
  • 69
  • 1
    so you want VS to code for you?? or to assist you?? VS already have feature which assist you to rename the namespaces.. put the cursor at the end of the line defining namespce for that particular class. and press "Ctrl+." it will show the context meny type suggest saying to rename the namespace to match with folder structure.. select that.. it will name the namespace as per structure.. but only for that class or cs file only.. – Deepak Sharma Jan 09 '15 at 04:54
  • @DeepakSharma I'm not sure you finished that properly, "Ctrl+" looks like half a shortcut input, like "Ctrl+I" for example. And "Ctrl" and "+" don't do anything... – Ben Jan 09 '15 at 05:01
  • man check properly I wrote **" Ctrl + ."** notice dot is here after control – Deepak Sharma Jan 09 '15 at 05:06
  • Oh sorry. The text is so small I didn't even see the "." – Ben Jan 09 '15 at 05:07
  • not an issue.. it happens.. and yeah if you have installed some tools like reSharper it may overwrite the existing shortcut.. if you have installed it.. try **"Alt + "** – Deepak Sharma Jan 09 '15 at 05:08
  • Unfortunately the "Ctrl + ." isn't working. And I don't have re-sharper. – Ben Jan 09 '15 at 05:09
  • 1
    try this if it works for you.. sorry I don't have 2010, working on 2013 :D http://stackoverflow.com/questions/174193/visual-studio-is-there-a-move-class-to-different-namespace-refactoring#answer-3360343 – Deepak Sharma Jan 09 '15 at 05:14

0 Answers0