Interview Questions

I can’t import the COM object that I have on my machine. Did you write that object?

.NET Database ,COM interop,and .NET deployment questions and answers


(Continued from previous question...)

I can’t import the COM object that I have on my machine. Did you write that object?

You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object.

The answer to (5) is only partially correct. You *can* import COM objects, even if they are not your own. It is recommended that you obtain the Primary Interop from the vendor, but not required. The most common problem importing a COM DLL is that it exposes objects that form part of a separate COM DLL. You can generate interops for these additional DLLs, and then refer to them when importing the problem DLL.

(Continued on next question...)

Other Interview Questions