문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top