c++ - Deployed 64bit c# application can't load unmanaged dll -


i have 64bit web application written in c# deployed iis on both windows server 2008 (iis 7) , windows server 2012 (iis 8).

part of application involves accessing unmanaged c++ dll c# code. call failing when deploy iis. classic:

an attempt made load program incorrect format. (exception hresult: 0x8007000b)

i have read many threads on topic, including:

an attempt made load program incorrect format error

“an attempt made load program incorrect format” when platforms same

but don't think apply as

  1. i have 64 bit application.
  2. it's compiled x64
  3. it's deployed x64
  4. i have verified running under x64 iis apppool.
  5. enable32bitapplications set false.
  6. both c# dll importing , unmanaged dll compiled 64bit.
  7. i have deployed iis on server machines in both release , debug mode - no difference.

there 32 bit dlls in application, in separate projects not referenced by, nor reference, project throwing error.

for additional information, runs fine on both local machine in iis express , local machine when deployed through iis (windows 7), there disconnect somewhere , can't track down.

additional info:

the unmanaged dll have dependencies on:

  • kernel32.dll
  • advapi32.dll
  • crypt32.dll
  • user32.dll
  • version.dll

i realize these 32bit thought these 32bit, on 64 bit machine these live in system32, i'm not sure... if so, how can compile unmanaged dll compiled 64 bit.

also, why work locally me?

also, have (just kicks , skittles) set enable32bitapplications true , same error, project 64 bit project , references 64bit unmanaged dll, can't run in 32 bit process.

there additional dependency unmanaged dll c++ redistributable dll. copy of dll on machine 32 bit, once swapped out version 64 bit, loaded fine.

lesson learned, dependencies of dll must present , correct bitness.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -