Visual Studio: Is there a “move class to different namespace” refactoring?

前端 未结 9 1570
太阳男子
太阳男子 2020-12-20 12:17

I\'m doing some architectural cleanup that involves moving a bunch of classes into different projects and/or namespaces. Currently I\'m moving the files by hand, building, a

9条回答
  •  被撕碎了的回忆
    2020-12-20 12:44

    If you cannot, or do not want to use Re$harper, Notepad++ is your friend:

    1. Make sure you don't have usaved changes inside Visual Studio for the files you need to move to the new namespace
    2. Open all the files that contain the namespace that needs to be changed in Notepad++
    3. Open Find & Replace (CTRL + H)
    4. Fill the Find what and Replace with fields
    5. Press Replace All in All Opened Documents
    6. Save all changes in all documents (CTRL + SHIFT + S)
    7. Switch to Visual Studio and reload all the documents (Yes to all at the prompt)

    DONE

提交回复
热议问题