What is the purpose of a TT extension file?

Asked

Viewed 256 times

4

Well, I was searching around the Internet for a way to create a string as template, based on an archive of template. I came across an answer from SOEN that talks about files .tt, to use a template in "running time".

I would like to know more about these files:

  • What’s this extension for .tt and how to use it?
  • What I need to do to use it in Visual Studio, for example?
  • Is it safe to use it for what purposes? For example, I intend to use it to assemble body of emails (use Webforms :).

1 answer

6


It’s a file of template used by Visual Studio (T4). It is used to create snippets of code and other forms that give a basis of what you want to do.

It was used a little more for code generation, but Roslyn (.NET Compiler Platform) has diminished its need. Yet it can be used as a basis for Roslyn to generate some code. Almost everything where it was needed has better tool nowadays.

He wasn’t exactly raised to templates data, and yes codes. But nothing prevents you from using it for your emails, just do not know if you have much infrastructure ready for this, you will have to interpret it. nor has recent documentation of TextTransformation . More Visual Studio documentation. Has something a little newer.

I would use the Razor with template for emails. In most cases not even that would need to be done, a simple interpolation may suffice.

No more tool in Visual Studio.

Security depends on how you use it. Naively it can be unsafe.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.