I read a lot of questions and answers, indicating that if I want to link my C # project with my native libraries, I cannot use the target AnyCPU platform, but I have to make separate 32- and 64-bit assemblies, each of which is associated with a native DLL corresponding bitness.
This makes you wonder how the .NET Framework assemblies themselves or, at least, seem to be created for AnyCPU . That is, adding a link to my GUI application, why donβt I have to choose the 32-bit or 64-bit version of System.Windows.Forms ? I thought it might just be Visual Studio magic, which would allow the corresponding GAC subdirectory (GAC_32 or GAC_64), but I looked for System.Windows.Forms.dll in the GAC and found it in:
C: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.Windows.Forms \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Windows.Forms.dll
Pay attention to the "GAC_MSIL". So, how does this DLL manage to wrap its own 32-bit API, but still remains a binder in a 64-bit application? And why can't I use a similar strategy to make a single C # DLL that references its own 32-bit library, but remains operational in 64-bit mode?
adv12 source share