Subsonic 3 not generating classes

こ雲淡風輕ζ 提交于 2019-12-25 09:40:48

问题


I followed the 3 step procedure 20 times on 3 different sytems under all possible conditions and no matter what I do it won't generate the classes. I keep getting the following error:

Loading the include file 'SQLServer.ttinclude' returned a null or empty string. The transformation will not be run.

Any ideas?


回答1:


I have tried all the solution I found on google but no luck. So I decided to dig into this issue. As you can see, the error tell that generator can not load the include file "SQLServer.ttinclude" although the include file exists. If it can not read include file, why don't we include content of SQLServer.ttinclude instead of including file ?

Copy content of SQLServer.ttinclude to all *.tt as below steps:

  1. Make sure that you have follow this instruction on Subsonic homepage first [link text][1]

    [1]: http://subsonicproject.com/docs/Using_ActiveRecord

  2. For each .tt file:

    • Delete <#@ include file="SQLServer.ttinclude" #>
    • Copy and paste content of SQLServer.ttinclude to the end of .tt files
  3. Right click on .tt files -> Run custom tool. The *.cs files will be generated. Compile now !!!!

A little funny thing that I've noticed: After doing above steps and get *.cs file generated. You can simply copy and paste template files again into your solution explorer exact the instruction in [link text][1] and the *.cs file generated without doing any tricks !!!

Hope this helps.

Hai




回答2:


Try adding the .tt and .ttinclude files to the VS project via Right click -> Add -> Existing Item, rather than dragging the files into VS. Seemed to make the difference for me.




回答3:


Check the rights associated with the credentials used to authenticate access to the database. You need dbo access for the entity classes to be generated.



来源:https://stackoverflow.com/questions/3243181/subsonic-3-not-generating-classes

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