问题
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