title: Analyze 64-bit DLL from within T4 template in Visual Studio (32-bit) using Reflection
body: <p>I would like to analyse a DLL from within a T4 template using Reflection, so that I can generate code based on the results of the reflection analysis. I know EnvDTE would be a better option, but this is not possible in my case for several reasons.</p>
  
  <p>The problem with reflection is that the DLL is a 64-bit DLL and if I load that within the T4 template I get a <code>BadImageFormatException</code> because I am trying to load a 64-bit DLL into a 32-bit process (Visual Studio 2012).</p>
  
  <p><strong>Is there any way to analyse the contents of that DLL within T4, preferrably using reflection?</strong></p>
  
  <p>I have already thought about writing a console application which analyses the DLL, writes the results to an XML file which is then consumed by the T4 template, but that is not really my favorite solution...</p>
  
  <p>BTW: The DLL is a managed C++ DLL. So Roslyn is no option either because it only supports C# and VB).</p>