The most common cause for this error is bitness mismatch. The process is 32 bit, the failing assembly 64 bit. Or vice versa. If that is so then you have two possible solutions:
- Build a 32 bit version of the assembly using a 32 bit version of the static library.
- Ensure that the web service executes in a 64 bit process.