Creating T4 template file referring SubSonic

折月煮酒 提交于 2019-12-11 04:49:58

问题


I am trying to write T4 template to create wrapper classes for classes created by SubSonic 3 (implementing IActiveRecord). But when I compile my template I get following error:

Compiling transformation: Metadata file 'SubSonic.Core' could not be found

I'm including SubSonic.Core in my settings file. <#@ assembly name="SubSonic.Core" #> and then importing the namespaces like <#@ import namespace="SubSonic.Schema"#> and <#@ import namespace="SubSonic"#>

What I'm doing wrong? Do I need to put SubSonic.Core.dll into GAC?


回答1:


Have you tried putting .dll at the end of the assembly name?

<#@ assembly name="SubSonic.Core.dll" #>

(Make sure that SubSonic.Core.dll is in the same directory).

There is an article on the T4 Assembly directive that may help you:

http://www.olegsych.com/2008/02/t4-assembly-directive/


来源:https://stackoverflow.com/questions/3385501/creating-t4-template-file-referring-subsonic

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