Loading a NuGet assembly in T4 Template -
Loading a NuGet assembly in T4 Template -
i need reference type in 1 of assemblies referenced project containing visual studio t4 template. however, referenced assembly installed nuget package. nuget reference evolves, path nuget places in within solution's packages folder. example, suppose nuget bundle is:
facade.contract.1.0.1-alphathen relative path project is:
..\packages\facade.contract.1.0.1-alpha\lib\net4\facade.contract.dllif prerelease updated beta, path change. when bundle released, path change. , every time path changes, assembly line in *.tt file out of date:
<#@ assembly name="..\packages\facade.contract.1.0.1-alpha\lib\net4\facade.contract.dll" #>i don't think there's way accomplish straight assembly directive; however, i'm open crazy ideas. load assembly myself current, or subordinate or reflection-only appdomain?
i think could, i'm not sure how go dynamically discovering path referenced assembly in project's references using t4 logic.
any ideas?
the nuget team has made extension available allows command on packages in solution/project. if have command on environment , can sure has this installed might able search installed packages , dynamically load them during t4 execution. since these nuget assemblies complied , not part of solution/project think using standard assembly.load work need test that.
nuget .net-assembly t4
Comments
Post a Comment