When referencing an assembly inside a .tt T4 template, I should be able to use the following declaration:
<#@ assembly name="$(SolutionDir)\..\..\Build\lib\HedgehogDevelopment.CodeGeneration.Extensions.dll" #>
From what I can see, the SolutionDir is not being transformed, and I get an error message (below)
Note: The HedgehogDevelopment.CodeGeneration.Extensions.dll cannot be added to the GAC or the Visual Studio assembly folder as the DLL needs to passed along with the project.
I don't know how the TDS code generation is executed, so I am asking here to see if someone has resolved something similar.
Error | 10 |The host threw an exception while trying to resolve the assembly reference '$(SolutionDir)......\Build\lib\HedgehogDevelopment.CodeGeneration.Extensions.dll'. The transformation will not be run.
The following Exception was thrown: System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) at System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent) at System.Reflection.AssemblyName..ctor(String assemblyName) at Microsoft.VisualStudio.TextTemplating.GlobalAssemblyCacheHelper.GetLocation(String strongName) at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolveAssemblyReference(String assemblyReference) at Microsoft.VisualStudio.TextTemplating.Engine.ResolveAssemblyReferences(ITextTemplatingEngineHost host, TemplateProcessingSession session)