You cannot access the code that is in your project from your template. Even if you could, how would this happen? The template is executed at design time.
Use the Inherits directive, specify the name of your class. http://technet.microsoft.com/en-us/query/bb126474 See "Using a different set of utility methods." Your class should inherit from Microsoft.VisualStudio.TextTemplating.TextTransformation
<#@ template inherits="MyUtilityClass" #>
This, or you can create your module in the assembly, and then refer to the assembly from the template
<#@ assembly name="MyAssembly.Utilities" #>
or you can just put your utility methods in a class function block in another template and then include it in your main template
<#@ include file="MyUtilities.tt" #>
source share