C # platform interoperability deployment

Source: Internet
Author: User

The program uses the platform interoperability p/invoke to call the DLL of MFC in C #. programs can run normally in systems installed with the VS2008 development environment, but copying data to other machines won't work ,. net framewark is also the latest version. I don't know what to do.

A. dll is developed by someone else using VC6.0. It exports A class without source code.
B. dll is A packaging of A. dll. It is developed in VC ++ 2008. It packs member functions of the class into global functions and exports them.
C. dll is a package for B. dll. C # is developed. Use P/Invoke to call functions in B. dll.
D.exe is the final program that references C. dll

Later, depends.exe was used for analysis and found that B. dll in the Debug directory used MSVCR90D. dll. The strange thing is that this file cannot be found and can be run on the machine where VS is installed even if it cannot be found.

I checked some materials and found that MSVCR100.dll may have a BUG, which is also related to the compilation mode. So I used RELEASE to compile and solve the problem and run it everywhere.

Subsequent analysis using depends.exe found B in Release mode. the dll uses MSVCR90.dll, and end with a D missing. It should be the debugging version and the official version. at this time, I thought that there were a lot of DLL for debugging in the VS environment, and the DLL at the end of D was not included in the installation of the VC ++ 2008 package for MS, this causes the problem.

Therefore, do not worry about the release of the DEBUG version for users. I know many people have this habit. Bad habits !!! If you do not need to contact customer service early, you will pay a higher price later to find the problem.

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.