Visual Studio 重构 - 将类移至程序集
我正在寻找最简单(也是最完整)的机制,将类从一个程序集移动到另一个程序集,并具有引用(依赖性)修复功能。我知道一些手动方法可以做到这一点,例如: - 使用内置移动重命名,然后剪切粘贴,多次保存... - 使用 resharper 重命名名称空间、 cutpaste ,与上面相同,
但问题与这些相同:在 Web 环境(即 ASP.Net)中几乎所有引用(例如,对于用户控件,让我们假设程序集名称在它们的虚拟路径提供程序场景的路径)被编码为字符串引用(更不用说配置文件和其他外部引用源) - 不幸的是,即使 resharper 也没有找到全部。 其他问题与设计器文件有关 - 您知道它们至少是根据控制中的规范在保存操作中生成的,有时它们以某种方式与重命名操作混合在一起,我的意思是这里是旧的,有新的程序集名称等。
谢谢进步, 尼科莱
I'm looking for the simplest (and most complete) mechanism to move a class from one to another assembly with reference (dependency) fixing capability.I know some manual ways to do that like :
- use built-in move rename, then cutpaste, multiple save ...
- use resharper rename namespace, cutpaste , the same as above
but with the problem is the same with those : in a web environment (namely ASP.Net) almost all of the references (for user controls for example, let's suppose with assembly name in their path for a virtual path provider scenario) are coded a string references (not to mention the configuration files and other external reference sources) - unfortunately even resharper doesn't found all. Other problem is with the designer files - you know they're generated on at least save action accordingly to the specifications in control and sometimes they're somehow mixed with the rename action I mean here's the old there's the new assembly name etc.
Thanks in advance,
Nicolai
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Resharper,请尝试测试驱动开发,
它允许像这样的重构次数。
If you are using Resharper try the Test Driven Development
It Allows a number of refactors like that.