我使用 ReSharper 的 Refactor->Move 命令将一组 ASPX 页面移动到另一个文件夹。
从 ReSharper 我们有:
移至文件夹
此重构有助于移动类、文件或选择的类
或文件到解决方案中的另一个项目或文件夹。当执行
移动时,ReSharper 会在必要时使用指令进行更新。可选地,它
可以根据新位置重命名命名空间并分发
类被移动到单独的文件中。
移动这些页面后,所有引用 CSS 文件的链接都被破坏了。
当我在源代码视图中打开 ASPX 页面时,我得到如下内容:

我认为如果它提供替换它已经知道在哪里寻找正确的文件。
带有问号的提示很有帮助,但我必须打开每个页面并逐个链接更正链接。
ReSharper 6.0 没有自动更正所有链接的方法吗?如果答案是否定的,我认为“移动到文件夹”命令中应该实现这样的功能。
I moved a set of ASPX pages to a different folder using ReSharper's Refactor->Move command.
From ReSharper we have:
Move to Folder
This refactoring helps move a class, a file, or a selection of classes
or files to another project or folder in solution. When executing the
move, ReSharper updates using directives if necessary. Optionally, it
can rename namespaces according to the new location and distribute
classes being moved to separate files.
After moving those pages, all the links that reference CSS files got broken.
When I open an ASPX page in source view I get something like this:

I think that if it's offering a substitution it already knows where to look for the correct file.
The hint with an interrogation mark helps but I have to open each page and correct link by link.
Isn't there an automated way of correcting all the links with ReSharper 6.0? If the answer is negative, I think there should be such a feature implemented in the Move to Folder command.
发布评论
评论(1)
恐怕答案是否定的。
是的,提示功能很好,不仅适用于“移动到文件夹”重构,而且适用于一般用途(例如,剪切和粘贴文件)。我们考虑过,但由于 UI 不清楚而推迟了(我们需要一种方法来指示此类文件引用,对其应用更新,并在必要时取消)。
I am afraid, answer is negative.
Yep, prompted feature is good, not only for Move to Folder refactoring, but for general purpose (for example, cut&paste of files). We thought about it but postponed since UI is not clear (we need a way to indicate such file references, apply updates to them, and cancel, if necessary).