模板作为目标解决方案的一部分运行,但不作为指导包的一部分运行 [英] Template runs as part of the target solution but does not run as part of a Guidance Package

查看:59
本文介绍了模板作为目标解决方案的一部分运行,但不作为指导包的一部分运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在我的t4模板中使用自定义库














< #@ template language = " C#" >
< font style ="color:blue">< #@ assembly name < font style ="font-size:11px"> = " Custom" >
< #@ import namespace =" CustomNamespace">

解决方案

Hamanu,

Guidance Automation Extensions使用不同的主机。不幸的是,这个主机实现了一种完全不同的解析程序集引用的方法。据我所知,它并不试图在GAC中找到程序集。相反,它将在Visual Studio 9.0 / Common7 / IDE中的PublicAssemblies和PrivateAssemblies文件夹中查找它。如果将自定义DLL放在其中一个文件夹中,并且在<#@ assembly#>的name参数中指定程序集名称和扩展名,则应该能够从指导包转换模板。指令。

Hi

I want to use custom library in my t4 template

 
<#@ template language="C#" #>
<#@ assembly name="Custom"#> 
<#@ import namespace = "CustomNamespace">

解决方案

Hamanu,

Guidance Automation Extensions uses a different Host for the T4 engine. Unfortunately, this host implements a completely different way of resolving assembly references. From what I can tell, it does not attempt to locate the assembly in the GAC. Instead, it will look for it in the PublicAssemblies and PrivateAssemblies folders in Visual Studio 9.0/Common7/IDE. You should be able to transform your template from a Guidance Package if you place your custom DLL in one of these folders and specify both assembly name and extension in name parameter of the <#@ assembly #> directive.


这篇关于模板作为目标解决方案的一部分运行,但不作为指导包的一部分运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆