我有一个开源项目,我必须指示用户将 dll 放在 c:\NPEG.dll https://github.com/leblancmeneses/AngularKendo.IntegrationTests/blob/master/AngularKendo.IntegrationTests/CodeTemplates/Scaffolders/ T4WithNUnitFeature/T4WithNUnitFeatureTemplate.cs.t4
相反,我想支持: <#@ assembly name="$(TargetDir)NPEG.dll" #> https://github.com/leblancmeneses/RobustHaven.IntegrationTests/blob/master/T4/CodeTemplates/Scaffolders/T4WithNUnitFeature/ T4WithNUnitFeatureTemplate.cs.t4
但是,这会导致引用混乱、程序集加载错误,因为它无法找到。
NPEG.dll 将位于 bin 目录中。
有谁知道我可以如何使用 T4Scaffolding 解析相对 dll?
编辑
重现步骤
我已经检查了 csproj 的更改。程序集引用应该适用于:“NPEG.dll”和“$(myLibFolder)NPEG.dll”——但是,它不能
- 在此处克隆项目: https ://github.com/leblancmeneses/AngularKendo.IntegrationTests/tree/T4Scaffolding
- 包管理器控制台将默认项目设置为:“AngularKendo.IntegrationTests”
- 在包管理器控制台中运行以下命令
.
Scaffold T4WithNUnitFeature "Gherkin\NgModelDotNotationIsInitialized.feature" -Force
参考
- http://netitude.bc3tech.net/2013/06/15/t4-gotchyas-in-your-environment/
- http://msdn.microsoft.com/en-us/library/ee847423.aspx
- http://blogs.msdn.com/b/t4/archive/2013/08/29/what-s-new-in-t4-for-visual-studio-2013.aspx
谢谢您的帮助。