有哪些 T4 编辑工具?

发布于 2024-09-29 08:56:31 字数 1027 浏览 0 评论 0原文

我不经常使用T4模板;通常当我这样做时是编辑其他项目的项目(特别是 SubSonic 和 T4MVC)。这种体验总是非常不愉快(这当然就是我不经常使用它们的原因)。

这些是我所知道的工具,但它们都不完全符合要求。

  1. Clarius Visual T4

    • 不支持 Visual Studio 2010。他们的博客提到正在进行的工作,但那是 2 个月前的事,此后没有任何更新。他们的支持论坛充满了垃圾邮件和有关何时支持 VS2010 的问题。
      我从事的大部分项目都在 Visual Studio 2010 中进行,我处理的模板要求自身在 Visual Studio 主机中运行(因为它们通过 VS 的自动化对象模型访问项目信息)。这就是我寻找 VS2010 兼容编辑器的原因。
  2. 有形 T4 编辑器

    • 我第一次尝试使用此功能时,我以为 Visual Studio 2010 已崩溃。结果我等待的时间不够长(编辑器窗口花了 2 分钟多才出现)。你可以说我很挑剔,但仅此一点就让我放弃了这个工具。

    • 我有一个修改后的 T4MVC 模板,可以正常工作。在我安装 Tangible 的 T4 编辑器后,模板失败并出现多个错误。如果我随后卸载 Tangible 的 T4 编辑器,该模板将再次运行。因此,编辑器似乎改变了 Visual Studio 中 T4 的行为。也许显然,这是完全不可接受的。

还有其他我错过的 T4 编辑器吗?还有其他人使用这些工具,遇到这些相同的问题,并成功地使用它们吗?

我还应该说,对我来说最重要的功能就是区分作为模板一部分运行的代码和获取输出的代码/文本。其他一切都是肉汁。

I don't use T4 templates often; usually when I do it is editing those of other projects (specifically SubSonic & T4MVC). The experience is always quite unpleasant (and this is certainly why I don't use them more often).

These are the tools I know of, and neither of them quite fit the bill.

  1. Clarius Visual T4.

    • Does not support Visual Studio 2010. Their blog mentions work ongoing, but that was 2 months ago with no updates since. Their support forum is filled with spam and questions about when VS2010 will be supported.
      Most of the projects I work on are in Visual Studio 2010, and the templates I deal with require themselves to be run in the Visual Studio host (as they access project information through VS's automation object model). This is why I am looking for a VS2010 compatible editor.
  2. Tangible T4 Editor

    • The first time I attempted to use this, I thought Visual Studio 2010 had crashed. Turns out I didn't wait long enough (it took over 2 minutes for the editor window to appear). Call me picky, but this alone puts me off of this tool.

    • I have a modified T4MVC template that works. After I install Tangible's T4 editor, the template fails with several errors. If I then uninstall Tangible's T4 editor, the template works again. So it would seem something about the editor changes the behavior of T4 in Visual Studio. Perhaps obviously, that's entirely unacceptable.

Are there any other T4 editors I missed? Does anyone else use these tools, encounter these same issues, and successfully work with them?

I should also say, the most important feature for me is simply to distinguish between code that runs as part of the template and code/text that gets output. Everything else is gravy.

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

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

发布评论

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

评论(2

木格 2024-10-06 08:56:31

DevArt 发布了适用于 Visual Studio 的 T4 编辑器插件。它是免费的并且运行良好。不过,他们似乎还没有 Visual Studio 2012 的版本。

我还遇到过一个用于编辑T4文件的ReSharper插件,但我没有使用过它,无法发表评论它的工作效果如何(或不工作)。

DevArt has released a T4 editor add on for Visual Studio. It is free and it works well. They do not appear to have a version for Visual Studio 2012 yet, however.

I have also come across a ReSharper plugin for editing T4 files, but I have not used it and cannot comment on how well it works (or does not).

故人爱我别走 2024-10-06 08:56:31

查看 T4 工具箱

Check out the T4 Toolbox.

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