I am creating a class library, which I hope to put on NuGet eventually. Right now, it is targeting AnyCPU.
I now want to PInvoke into a DLL, which comes in both 32 and 64 bit versions. Initially, I thought I'd just use the 32 bit version, but this threw a BadImageFormatException. I changed the library to target X86 only, and while this works, it requires the caller to be a 32 bit process too. This naturally wouldn't work for a NuGet project.
Appreciate any thoughts on how to work with the 32/64 bit versions of the native library, and how to package this up in NuGet (prefer not to have 2 different assemblies).