I have an odd issue that hopefully someone else has encountered.
- I have a Unit Test (i.e.
TestFileExtract
) - that calls a method in a class (
Test.Expand.Uncompresss
) - that makes a call to a referenced DLL
- that makes a call to the ZLIB1.DLL
- to uncompress a file.
Here is the import :
[DllImport(ZLIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int uncompress(byte[] dest, ref int dest_len, byte[] src, int src_len);
There is an existing console app that loads the 1st Assembly, calls the method that triggers the uncompress with no issues. However, when I make the exact same call from within my unit test, it fails with BadImageFormatException
.
I tried setting the test to x64, x86, auto with no success. I also tried rebuilding the calling assembly to x64/AnyCPU. Same results. I'm sure (hoping) it's something I've overlooked.
Any ideas?