T4 for Sharp Architecture/Northwind Problem

让人想犯罪 __ 提交于 2019-11-30 18:41:24

I have received this using other T4 templates. The problem ends up being spaces at the end of the file (following the very last '#>' ).

Open your .tt file in VS, CTRL+END, make sure all spaces are removed following the last #>

 string someMethod()
 {
     //some code
    return "someValue";
 }
 #>

Props go to a post by Cheverton: http://social.msdn.microsoft.com/Forums/en-SG/vsx/thread/cd1217c1-39b0-4799-86a2-2449e21a8544

I realize this is an old question, but I had the same problem just now, and in my case it turns out it was the line endings. They were LF, but needed to be CRLF.

After I made some edits to the .tt file, closed the editor, and opened it again, I had both LF and CRLF line endings in the same file, at which point Visual Studio offered to fix this for me. Once I had consistent CRLF line endings in the .tt file, it worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!