Questions tagged [t4-toolbox]

For issues relating to the T4 Toolbox Visual Studio extension to extend the code generation functionality of T4 text templates.

T4 Toolbox is a Visual Studio extension that extends the code generation functionality of the T4 text templates. It allows to:

  • Generate multiple output files from a single text template
  • Automatically add output files to one or more projects and folders
  • Automatically add or check-out generated files from source control
  • Edit text templates in Visual Studio 2015 with syntax colorization, outlining, QuickInfo tooltips, error reporting and statement completion
29 questions
14
votes
4 answers

T4 Toolbox - Referencing Class in Current Assembly

I am writing a T4 script which reflects over certain classes and provides code generation based on them. The problem is that my script errors out, saying that the classes in my current project cannot be accessed. The script itself resides in the…
Nicko-Mctricko
  • 461
  • 5
  • 6
14
votes
3 answers

T4 Toolbox - mixing class feature and statement blocks

I'm a T4 newbie trying to use T4 Toolbox to generate F# code based on this answer, but it seems that class feature blocks can't be mixed with statement blocks. Here's my code: <#@ template language="C#" hostspecific="True" debug="True" #> <#@ output…
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
12
votes
1 answer

T4 append output to existing file

Is it possible to make a T4 template output to be merged with an existing file? For example, if a T4 template generates localization resource XML files, is it possible to merge them in some existing resource file?
Sly
  • 15,046
  • 12
  • 60
  • 89
6
votes
2 answers

VS2010 T4 auto checkout of generated files from TFS fails

I'm trying to use such simple scheme in my project: Item.cs -> this contains c# partial class with simple entity properties. It has set also property "Custom Tool: T4ScriptFileGenerator" so it attaches "grouped" file Item.tt to it. Wich on its way…
justmara
  • 240
  • 2
  • 12
5
votes
2 answers

T4 output filename

How can i use generated file's name in template? I'd like to something like this: // This file: <#= OutputFileName #> was autogenerated How can i do that in T4 or in T4Toolbox?
Simon
  • 2,329
  • 4
  • 30
  • 49
4
votes
0 answers

Applying .tt on build using T4ToolBox

I have got some .tt files in my solution for a long time. I recently decided to launch the transformation at build time by adding to my csproj : true
NicoGDF
  • 97
  • 12
3
votes
3 answers

T4 templates - refreshing solution explorer in Visual Studio 2010 from one application domain to another

<#@ template debug="true" hostspecific="true" language="C#" #> <#@ assembly name="EnvDTE80" #> <#@ include file="T4Toolbox.tt" #> <# IServiceProvider serviceProvider = (IServiceProvider)this.Host; EnvDTE80.DTE2 dte =…
Rad
  • 933
  • 1
  • 15
  • 32
3
votes
1 answer

Use VolatileAssembly directive without installing the T4 Toolbox

I'd like to use VolatileAssembly from the T4 Toolbox but do not want to require all developers to install the T4 Toolbox. Is it possible include the DLL with with project in source control and reference it by path?
Brian Low
  • 11,605
  • 4
  • 58
  • 63
3
votes
1 answer

T4 Toolbox Linq2Sql

I'm trying to use t4toolbox to generate the linq2sql classes for a project. There is already a lot of code written against the default dbml generated code. In the LinqToSqlEntityClassTemplate.tt file it has /// /// While MSLinqToSQLGenerator…
John Boker
  • 82,559
  • 17
  • 97
  • 130
3
votes
2 answers

How do you run a T4Toolbox Generator or CSharpTemplate?

I downloaded and installed the T4Toolbox to work with T4 templates more easily... however, I can't even figure out how to run the Generator or CSharpTemplate. Here is an example file I created: Template1.tt: <#+ public class Template1 :…
michael
  • 14,844
  • 28
  • 89
  • 177
2
votes
1 answer

Is is possible to call the T4 custom tool TextTemplatingFileGenerator directly in VS2008, for e.g. using an addin

I want to know if it is possible to call the T4 custom tool TextTemplatingFileGenerator directly in VS2008, for e.g. using an addin. The case I have is that I have metadata (xml) files in the solution. The T4 template reads these files to generate…
ilias
  • 2,620
  • 2
  • 27
  • 37
2
votes
1 answer

What is purpose of T4 Generator in T4toolbox

I am using T4toolbox, I am confused what the generator is for. I can run the following public class Generator1 : Generator { protected override void RunCore() { Template1 t = new Template1(); t.Output.File = "t3.txt"; …
Fred Yang
  • 2,521
  • 3
  • 21
  • 29
1
vote
1 answer

Visual Studio Item Template using T4 Templates

I want to create a Visual Studio Item Template that generates an Item (for eg. custom .aspx page) in the solution by executing T4 Template while adding it to the solution. I read the following post : T4 Templates and Visual Studio Item Templates Is…
Mayur
  • 53
  • 1
  • 10
1
vote
2 answers

T4 Compiling transformation: The type or namespace name 'Template' could not be found

I am trying to generate a Xaml file using Template T4 and defining a reusable file Xaml.tt like this <#@ template language="C#" hostspecific="True" debug="True" #> <#@ assembly name="System.Xml.dll" #> <#@ assembly name="System.Xml.Linq.dll"…
404Dreamer_ML
  • 890
  • 3
  • 14
  • 25
1
vote
1 answer

Problem running TextTransform.exe when using T4Toolbox

I'm attempting to run TextTransform.exe to generate code using a T4 template file. The template file is dependent on the T4Toolbox (specifically, it contains classes implementing the T4Toolbox.Template class). As such, it includes the file…
Phil Young
  • 363
  • 3
  • 13
1
2