When I try to access the Host object from a non-static method declared in <#+#> brackets, everything works ok. But I need to access it from a class method, like this:
<#+
public class ProjectTraverser
{
public void Traverse()
{
var a = Host;
}
}
#>
I get the following error when this template executes: "Compiling transformation: Cannot access a non-static member of outer type 'Microsoft.VisualStudio.TextTemplating7D03DF372FEAC3D3A28C011A41F02403.GeneratedTextTransformation' via nested type 'Microsoft.VisualStudio.TextTemplating7D03DF372FEAC3D3A28C011A41F02403.GeneratedTextTransformation.ProjectTraverser' d:\Projects\Test Solutions\GettingStarted\TelerikMvc3RazorApplication\TextTemplate2.tt"
Please share any ideas.