What's the best way to do a bulk namespace rename on a large c# application?

后端 未结 7 1186
旧时难觅i
旧时难觅i 2020-12-15 15:41

First, a little background.

Currently namespaces and assemblies in our codebase (~60 assemblies, thousands of classes) looks like

WidgetCompany.Depar         


        
7条回答
  •  心在旅途
    2020-12-15 16:01

    Alternative solution if you've already partially renamed:

    • Open find and replace (shortcut ctrl + h)
    • Make sure regex is selected (icon like .*)
    • Paste the full name of your current namespace, for example YourSolution.YourProject
    • Paste this regex YourSolution.Your[partiallyRenamedNamespaceCharacters].*
    • Make sure Entire Solution is selected not Current Document
    • Run

提交回复
热议问题