Question

I am trying to put a helper method inside my T4 generator to make some of the generation logic a bit simpler, but I cant get it to compile correctly. I want to use this helper later in the .tt (not have it generated as output)

If I put the following

<#
    public static void Test()
    {
    }
#>

or

<#
    public static class Helpers 
    {
        public static void Test()
        {
        }
    }
#>

In my .tt i get the following error

Compiling transform: } expected

Is there a way to do this?

Was it helpful?

Solution

Try putting the second block inside <#+ #> (notice +)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top