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".

Source: Internet
Author: User

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".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.