title: Assembly references in T4 in Visual Studio 2012 .NET 4.5
body: <p>I am having problems using the T4 tool in Visual Studio 2012. My .tt-files have an assembly directive to a 64-bit .DLL built in the same solution. This is the output from debugging the tt file:</p>
  
  <blockquote>
    <p>Error 308 The host threw an exception while trying to resolve the
    assembly reference '$(TargetDir)\DCSGenerator.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&amp; 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)  C:\TFS\Dev01\CorePlatform\CoreServices\ImportExport.NET\ImportExport.NET\DicomInterface\TemplateUtilFunctions.tt    0   0   ImportExport.NET
    (CoreServices\ImportExport.NET\ImportExport.NET)</p>
  </blockquote>
  
  <p>Is anyone else having problems with this?</p>
  
  <p>Best Regards,</p>
  
  <p>UPDATE 2012-11-14 09:17 (CET): Visual Studio and hence the T4 generator runs as a 32-bit application and my assemblies are built as 64bit DLLs. This might be a source of the problem.</p>
  
  <p>UPDATE 2012-11-14 09:43 (CET): Tried to reference the assembly using the full path but this didn't solve the problem.</p>