how can I get intellisense in a T4 template?

Viewed 24689

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)

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

7 Answers

You can just download tangible's T4 Editor at t4editor.tangible-engineering.com it has Intelli-Sense for most important namespaces also in the FREE EDITION.

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.

For some reasons, I couldn't install the extensions mentionned in the other answers. My solution was to use Visual Studio Code to edit the .tt files. VS Code has some good t4 synthax highlighter plugins.

Related