Understanding T4: <#@ assembly #> directive
A friend at work pointed out this post by Oleg.
Here's the beginning of the post:
Here is how MSDN documentation defines the assembly directive.
The assembly directive identifies an assembly to be referenced so that you can use types within that assembly from code in the text template. Using the assembly directive is equivalent to using the Add Reference feature in Visual Studio.
This directive does not affect the source code of the compiled template. Instead it affects compiler options T4 uses to compile GeneratedTextTransformation into a .NET assembly. Here is an example of a T4 template and C# compiler T4 uses to compile it.
Template
<#@ template language="C#" debug="True" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.Xml" #>
<#@ import namespace="System.Data" #>
<#
DataSet dataSet = new DataSet();
#>
Compiler Options
/t:library /utf8output /D:DEBUG /debug+ /optimize- /w:4
/R:"...\System.dll"
/R:"...\System.Data.dll"
/R:"...\System.Xml.dll"
/R:"...\Microsoft.VisualStudio.TextTemplating.VSHost.dll"
/R:"...\Microsoft.VisualStudio.TextTemplating.dll"
/out:"...\qcckmauz.dll"
"...\qcckmauz.0.cs"
For the rest of the post