This project is read-only.

Running .tt Template outside VS 2010 , How ?

Oct 5, 2010 at 3:01 PM

Hi ,

I have created T4 CRUD template (following this,which I can run fine in VS 2010. But I want to run it through my custom application . Can I do this and how can I do this ?

And does T4 Toolbox provide API or Functionality to add autogenerated .cs files directly to VS Project ?

Thanks for your support.


Oct 12, 2010 at 6:51 AM

Just some ideas. You could use preprocessed templates and instantiate them in an external application. If you setup public properties on the template, you can set these after you instantiate the template, for example:

MyTemplate template = new MyTemplate();
template.Name = "Build Motion";
string output = template.TransformText();
Console.WriteLine("Output: {0}", output);
System.IO.File.WriteAllText("HelloWorld.txt", output);