作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在做一些架构清理,涉及将一堆类移动到不同的项目和/或命名空间中。目前,我正在手动移动文件、构建,然后根据需要手动添加 using Foo 语句来解决编译错误。有人知道更聪明的方法吗? (我们是 CodeRush 和 Refactor! 商店,但我很想知道 Resharper 是否支持此功能)
最佳答案
Visual Studio 2019 提供至少 2 个内置选项:
'Move to namespace...'重构可以在任何类上触发,VS 会提示输入目标命名空间。
'Change namespace to...'当当前文件命名空间与文件夹结构不匹配时,提供重构。
这可用于通过以下方式将各个类移动到不同的命名空间:
这些操作可确保所有引用都得到相应更新。
关于visual-studio - Visual Studio : Is there a "move class to different namespace" refactoring?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/174193/
我是一名优秀的程序员,十分优秀!