Glass Mapper t4 null or empty string

心不动则不痛 提交于 2019-12-12 04:56:55

问题


I'm trying to setup Glass Mapper to generate my Sitecore items. I've followed every tutorial I could find, but receive this error when attempting to generate the code:

"Loading the include file 'Helpers.tt' returned a null or empty string. The transformation will not be run."

A file is generated but repeats the word "ErrorGeneratingOutput" over and over.

Screenshots:


回答1:


As well as what Ehab has suggested, you may also have to remove the empty line at the end of GlassV3Header.tt otherwise you will get a error:

An error occured while generating code for item '/sitecore/templates'.
T4 Template: D:\Project\XYZ\TDS.Master\Code Generation Templates\GlassV3Item.tt

Errors:
Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration     
Compiling transformation: Method must have a return type     
Compiling transformation: Type expected

Crytic, but deleting the extra line solves the issue.




回答2:


Have you tried to click the unblock button in the properties window of the file?



来源:https://stackoverflow.com/questions/28306152/glass-mapper-t4-null-or-empty-string

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