Solve the problem that the InterOP. *. dll version generated by adding a com reference will always be 1.0.

Source: Internet
Author: User

When a reference to com is added to the project, InterOP is automatically generated. *. DLL, but the dll version is always 1.0. if you use InstallShield to create an installation package and modify the installation package, the DLL will not be updated because the version is always 1.0.

If you want to modify the version number, you can use tlbimp.exe to re-export a DLL without finding a convenient method. This tool can include the version number.

Tlbimp.exe (Type Library import program) References http://msdn.microsoft.com/zh-cn/site/tt0cf3sx

  1. Compile the original project to ensure normal operation. The release directory contains an InterOP. *. dll file. The version number of this file is 1.0.
  2. Find this file first. My machine file is in c: \ Program Files \ microsoft sdks \ windows \ v7.0a \ bin \
  3. Copy to a specific directory, or do not copy rows. Use the full path when writing bat.
  4. Execute bat with the following code:
"tlbimp.exe" ../player/release/MyCom.tlb /out:release/Interop.WebCameraATLFrameLib.dll /asmversion:2.1.1101.15007 /namespace:WebCameraATLFrameLib

 

Note:

"Tlbimp.exe":If it is not in this directory, write the full path.

../Player/release/mycom. TLB:The TLB file generated by COM, usually in the release directory

/Out: Release/InterOP. mycom. dll:Output file path

/Asmversion: 2.1.1101.15007:Version number of the output file

/Namespace: mycom:The namespace in the project must be the same as the namespace in the project. Be sure to confirm the case.

Make sure that the relative path above is normal.

Check the DLL in the release directory. The version number is available and runs properly.

 

You can also put the bat command in the subsequent operations of.

Can refer to this brother's approach: http://www.cnblogs.com/linlf03/archive/2011/11/18/2253760.html

 

If anyone finds a simpler method, please let us know. Thank you!

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.