如何重构 ” >>使用 ReSharper 在 ASP.NET 页面/视图中引用?

发布于 2024-11-25 00:38:03 字数 775 浏览 7 评论 0 原文

我使用 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:

enter image description here

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

︶ ̄淡然 2024-12-02 00:38:03

恐怕答案是否定的。
是的,提示功能很好,不仅适用于“移动到文件夹”重构,而且适用于一般用途(例如,剪切和粘贴文件)。我们考虑过,但由于 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).

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