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.
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 BadImageFormatException
because I am trying to load a 64-bit DLL into a 32-bit process (Visual Studio 2012).
Is there any way to analyse the contents of that DLL within T4, preferrably using reflection?
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...
BTW: The DLL is a managed C++ DLL. So Roslyn is no option either because it only supports C# and VB).