I have the following condition:
- I have an ASP.NET application with .NET framework 4.5 running at Windows 8 64 bit environment
- I have an external DLL library which I will need to use and that it will connect my system to another application locally.
I have tried the following:
- down porting my application to .NET 3.5 and 4.0
- call DLL library from a Singleton class, as well as static class
- compile and debug my application using x86
- testing to call the DLL from a Desktop, Web Service, or WCF applications
The problem is, the only successful way to call this DLL is by calling them either from Desktop, Webservices, or WCF applications. I can never call this DLL from my ASP.NET app no matter what condition I tried.
I always run into System.BadImageFormatException, saying that "Additional information: An attempt was made to load a program with an incorrect format . (Exception from HRESULT: 0x8007000B )"
Unfortunately I cannot put any further detail about this DLL. And having my ASP.NET application connected to WCF application runs into performance issues.
Any ideas?
P.S.: terribly sorry for my bad English. Any help would be appreciated.
EDIT:
I have seen the reference that has been given. Although, oddly enough, this reference didn't give any solution to my problem.
As I have mentioned before, I have tried to develop various test applications using x86 and x64 platforms, .NET framework 3.5, 4.0, and 4.5, and any other project type (Desktop app, WCF, except ASP.NET) can execute the DLL call.
Apparently, after a discussion with the author of the DLL, we conclude that only Desktop-like or Service-like applications can make calls to this type of DLL. My understanding was: "ASP.NET applications run within HTTP Context, which executes when user requests a resource" (I am sorry for my shallow understanding, but please correct me if I'm wrong..)
One questions remaining tho:
Is it considerably possible to generate a System.BadImageFormatException from this kind of case?