I have a WCF Service and a library, both being compiled for x64. The library has some NuGet packages which "appear" to be 32-bit. I get a System.BadImageFormatException
when I try to run or publish the WCF Service but, oddly, I don't get any warnings about mismatching architectures.
The full text of the error:
Additional information: Could not load file or assembly 'Library' or one of its dependencies. An attempt was made to load a program with an incorrect format.
As a test, I created a separate console application, added a reference to the library, made the architectures for both the console application and the library x64, and ran the console application. Same error.
The WCF Service application will be hosted in IIS and is being debugged with the WCF Test Client.
The NuGet packages I am using are these:
- CsvHelper (Josh Close), v2.16.3
- Newtonsoft.Json (James Newton-King), v9.0.1
I need to be able to run the service and library in 64-bit mode since I'm work with very large datasets, and need the extra RAM. My questions are
- Is my problem that the NuGet packages are not compiled for x64?
- How can I get this WCF service to run in this setup?