Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "A template containing a class feature must end with a class feature"

I was developing a C# T4 pre-processed template, under Visual Studio 2010, when I have got the following compilaton error:

A template containing a class feature must end with a class feature

like image 223
Julio Nobre Avatar asked Jul 07 '12 23:07

Julio Nobre


1 Answers

The error is caused by an invisible space after the last #>

It is also important to bear in mind, that invisible spaces may cause other hard-to-understand compile-errors.

If you want to see a bigger picture, just look at following links:

  • A good example
  • A good explanaton, by Ryan Pugh

Now that you are aware how harmfull invisible spaces can be when dealing with Text Templates, my advice is: Make them visible. If you don't know how to do it, see Jeef Widmer's blog

like image 197
Julio Nobre Avatar answered Oct 26 '22 22:10

Julio Nobre