I need to reference Type in one of the assemblies referenced by the project containing my Visual Studio T4 template. However, the reference assembly is installed from the NuGet package. As this Nuget link evolves, there will be a path that NuGet puts in the folder of my solution packages. For example, suppose my NuGet package is:
- Facade.Contract.1.0.1 alpha
Then the relative path to it from my project:
- .. \ packages \ Facade.Contract.1.0.1-alpha \ Lib \ NET4 \ Facade.Contract.dll
If the pre-publication is updated to beta, this path will change. When the package is released, the path will change. And every time the path changes, the pipeline in my * .tt file is out of date:
- <# @assembly name = ".. \ packages \ Facade.Contract.1.0.1-alpha \ lib \ net4 \ Facade.Contract.dll" #>
I don't think there is a way to do this directly with the build directive; however, I am open to some crazy ideas. Can I load the assembly myself into the current or subordinate or just to reflect the AppDomain?
I think I could, but I'm not sure how to dynamically detect the link assembly path in the project links using T4 logic.
Any ideas?
source share