Visual Studio 重构 - 将类移至程序集

发布于 2024-07-21 04:32:41 字数 404 浏览 2 评论 0原文

我正在寻找最简单(也是最完整)的机制,将类从一个程序集移动到另一个程序集,并具有引用(依赖性)修复功能。我知道一些手动方法可以做到这一点,例如: - 使用内置移动重命名,然后剪切粘贴,多次保存... - 使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦开始←不甜 2024-07-28 04:32:41

如果您使用 Resharper,请尝试测试驱动开发

它允许像这样的重构次数。

If you are using Resharper try the Test Driven Development

It Allows a number of refactors like that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文