PRB: Cannot Run Windows XP COM+ Code on Windows 2000 Computer (316873)



The information in this article applies to:

  • Microsoft COM+ 1.5
  • Microsoft COM+ 1.0

This article was previously published under Q316873

SYMPTOMS

If you develop code that performs COM+ adminstrative work on a computer that is running Microsoft Windows XP, and you run the code on a computer that is running Microsoft Windows 2000, you may receive "Interface not supported" error messages when you try to obtain COM+ catalog objects on the Windows 2000-based computer. This may occur whether you develop your application by using managed code (that is, code that runs in the Microsoft .NET common language runtime and uses an interop assembly) or unmanaged code (that is, code that uses COM directly).

CAUSE

The type library that contains the COM+ administrative interfaces on Windows XP is the Microsoft COM+ 1.5 version, and the type library that exists on Windows 2000 is the COM+ 1.0 version.

RESOLUTION

If you want to build an application that uses the COM+ administrative interfaces, and you want the code to run on both Windows 2000 and Windows XP, you can modify your code to create these objects by using late binding. (For example, in Microsoft Visual Basic, use the CreateObject method instead of the New method). See the language documentation about late binding.

This approach does not need the project to have references to given libraries. The library to use is resolved at runtime, because the string that is passed as a parameter to the CreateObject function is searched in the Windows Registry to find the library that the object belongs to. COM+ administrative code that is developed on Windows 2000 runs correctly on Windows XP.

If you are developing a .NET application, you can alternatively use the COMAdmin.NET component to work around this behavior. The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products. For more information, visit the following Web site: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

STATUS

This behavior is by design.

Modification Type:MinorLast Reviewed:3/9/2004
Keywords:kbprb KB316873 kbAudDeveloper