Calling 32-bit COM components through a. NET program in Windows Server 2008 X64

Source: Internet
Author: User
Tags command line visual studio

When developing the SMS interface, you need to invoke a COM component that is successful on the native test. However, the following error occurred on the server deployed to the Windows Server 2008 X64:

Retrieving the COM class factory for component with CLSID {79AD7B73-C515-40B4-8B02-CB0F5FA5A1A} failed due to the Followin G error:80070005

At deployment, the COM component is registered directly on the command line through Regsvr32.

After a few hours of this problem, I finally found the reason and the solution.

The server is using a 64-bit system, and the. NET program is compiled at the local level, and the target is selected as any CPU. NET programs run in 64-bit environments on the server.

It is found in the relevant data that 32-bit COM components cannot be accessed in a 64bit environment.

So just let. NET program to run in 32-bit way, you can solve the problem.

Workaround:

1, through the C:\WINDOWS\SYSWOW64\REGSVR32 registration components.

2. In Visual Studio, set the target platform for the compilation (Platform target) to: X86, and then recalculate the items.

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.