Can't reference an assembly in a T4 template

前端 未结 4 2060
孤独总比滥情好
孤独总比滥情好 2020-12-05 02:48

I have the following code in a tester class in my main assembly, PocoGenerator. This assembly is supposed to use a T4 template to generate POCO\'s based on L2S

4条回答
  •  感动是毒
    2020-12-05 02:52

    I had a similar problem when I tried to include Less Css for .NET in my Web project.

    I've ended up with copying the assembly in the root folder of my project and including it as a reference in the project itself. Then, I've added the following lines in the .tt file:

    <#@ assembly name="dotless.Core.dll" #>
    
    <#@ import namespace="dotless.Core" #>
    <#@ import namespace="dotless.Core.configuration" #>
    

    I'm sure that something similar should work with your assembly as well...

提交回复
热议问题