Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Resharper can do this, with the help of the ForTea Plugin that adds support for editing T4 (.tt) files.

http://visualstudiogallery.msdn.microsoft.com/en-us/60297607-5fd4-4da4-97e1-3715e90c1a23

Here you go with a plugin...

Vaseem.

EDIT

Also available for Visual Studio 2012: Tangible T4 Editor 2.3.0
Also available for Visual Studio 2015: Tangible T4 Editor 2.3.0
Also available for Visual Studio 2017: Tangible T4 Editor 2.4.0

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 try out Devart T4 Editor. It is free and provides syntax highlighting, intellisense, and code outlining support.

As Scott Hanselman also points out, the intellisense you might be expecting from some of the videos and articles on T4 are not built in to VS2008, you need the T4 Editor from Clarius, but they do have a community edition with some minimalist features to get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top