I'm new with t4.
I would like to generate code to cs file. I created a new tt file.
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ output extension=".cs" #>
class IOperation {
<#
OperationSection section = null;
#>
}
OperationSection is a class in the same assembly. I assume that I should use the "using" keyword.
How I do it? Now I receiving an error
Error 2 Compiling transformation: The type or namespace name 'OperationSection' could not be found (are you missing a using directive or an assembly reference?)
thanks
Use the import directive:
<#@ import namespace="YourNamespace" #>
Additionally, you might need to add an assembly directive to reference the assembly the class is defined in:
<#@ assembly name="$(SolutionDir)\MyProject\bin\Debug\SomeLibrary.Dll" #>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With