This project needs to do a C # write the WebService service to the external call, the service internally referenced the algorithm library, the local debugging has passed, the field deployment service when the various tips can not find the DLL file.
First , if there is a 32-bit library running on a 64-bit server system, there will be a run-time error, 64-bit IIS Default "application pool" does not enable 32-bit support, need to go to "advanced settings" to enable 32-bit support
second , the DLL processing method cannot be found:
DllImport path related to the online search:
DllImport will automatically search for the place in order:
1. exe directory
2. System32 Catalogue
3. Environment variable Directory
Three kinds of have tried useless, still hint can't find DLL, unable to load, with depends software to check the library file, the dependencies have, hundred think not its solution.
Finally forced the no way, the depends sent to the scene let them see the dependency of the algorithm DLL, and finally found that the field server is missing Msvcr100.dll and Msvcp100.dll, the local development environment has these. I hope people who have the same problem as me can find out earlier.
If the debugging environment is not a problem, it is inevitable that the actual application and debugging environment is different, the service can not run is not necessarily code-related.
A workaround for C # to use DllImport to import VC + + dynamic libraries after the site deployment prompt "Unable to load DLL, unable to find specified module".