如何在T4模板中获得智能感知? [英] how can I get intellisense in a T4 template?

查看:103
本文介绍了如何在T4模板中获得智能感知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试这些教程时( T4教程:创建可重用的代码生成模板)我注意到,尽管我使用的是普通C#,但是由于文件扩展名(.tt),我没有任何智能感知

When trying out these tutorials (T4 Tutorial: Creating reusable code generation templates) I noticed that although I was using plain c# I didn't get any intellisense, probably because of the file extension (.tt)

反正不是要与Visual Studio一起将这些.tt文件视为.cs文件,从而获得正确的智能感知帮助吗?

Isn't there anyway to say to Visual Studio to consider those .tt files as .cs files and thus get the correct intellisense help?

推荐答案

您可以购买T4编辑器的专业版.它在独立的.tt文件中非常有效,但是不幸的是,由于T4编辑器的专业版和T4本身在模板编译方式上的差异,您将在此教程中报告虚假错误,该错误依赖于

You can purchase the professional version of T4 Editor. It works very well in standalone .tt files, but unfortunately, due to the differences in how the pro version of T4 Editor and T4 itself compile the templates, you will get false errors reported for this tutorial, which relies on T4 Toolbox.

这篇关于如何在T4模板中获得智能感知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆