Asp. NET calls an unmanaged dll, cannot load the dll, cannot find the specified module workaround.

Source: Internet
Author: User

recently, a project was developed that used a DLL file interface for non-. net development, and found that after publishing to the window2003 server, the running Web site always prompts "unable to load DLL" D:\11\1.dll ": The specified module could not be found. (exception from hresult:0x8007007e). "this Error. But I can debug on a local XP System.

DLL uses COM calls as follows

[DllImport (@ "D:\11\1.dll", entrypoint = "aaa", CharSet = charset.ansi, CallingConvention = callingconvention.stdcall)]
public static extern Boolean AAA (bool x);

Question Address: http://topic.csdn.net/u/20121031/17/2085fdf4-cf81-4cf9-8650-e02c1ed8d67d.html

Workaround:

Step one: The DLL call uses an absolute path, such as DllImport (@ "D:\11\1.dll" or putting the calling DLL file into the system32 directory.

Refer to http://blog.csdn.net/xsgreen/article/details/3647501

Step Two: Use the Depends.exe tool to see which components (other DLL files) are referenced by the DLL file to be invoked, to search the server System32 directory, to compare whether the component referenced by the DLL exists in the server System32 directory, and if it does not exist, copy the missing DLL files to the same DLL file to be called The Directory. After comparison, found that the server system32 directory is missing borlndmm.dll this DLL file, copy Borlndmm.dll to the server D-disk 11 folder, The problem is Resolved.

Step Three: If the above has not been resolved, it should be a permissions issue, Select to call the DLL file folder, the right mouse button-"security-" add the ASPNET account (asp), check the full Control.

If the above three steps are not enough, you do not know.

SOURCE Address: http://www.cnblogs.com/slyzly/articles/2748940.html

Last note: Depends.exe tools, good ~ ~

Asp. NET calls an unmanaged dll, cannot load the dll, cannot find the specified module workaround.

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.