错误“包含类功能的模板必须以类功能结束”

时间:2022-01-04 09:47:27

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

当我得到以下compilaton错误时,我正在Visual Studio 2010下开发一个C#T4预处理模板:

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

包含类功能的模板必须以类功能结束

1 个解决方案

#1


32  

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:

如果您想要查看更大的图片,请查看以下链接:

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

现在您已经意识到在处理文本模板时有害的隐形空间是多么有害,我的建议是:让它们可见。如果您不知道如何操作,请参阅Jeef Widmer的博客

#1


32  

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:

如果您想要查看更大的图片,请查看以下链接:

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

现在您已经意识到在处理文本模板时有害的隐形空间是多么有害,我的建议是:让它们可见。如果您不知道如何操作,请参阅Jeef Widmer的博客