Search code examples
.netoledbconsole-applicationx86-64windows-7-x64

Windows x64 C# x86 console application exe seems to work with "DLL any CPU" Any potential problem?


My computer runs Windows 7 X64 Enterprise Edition. I need x86 mode for my executable as I use Visual Foxpro OLEDB driver. I thought it was required to compile library DLLs which are used by this exe as "X86". However, DLLs compiled with "Any CPU"seem to work which is quite convenient as they are used somewhere else and no need to maintain 2 copies. Just wondering how it works and should I continue like this ?


Solution

  • Any CPU DLLs will JIT compile to either x86 or x64 if the process is x64 or x86. As long as your exe is compiled as x86, the DLL will be JITed as x86. If your exe was x64 the DLL would be JITed as x64.