2

如果我有以下程序集:

MyComVisibleApi:VB 应用程序使用的.Net 程序集

MyReferencedAssembly:MyComVisibleApi 引用的 .Net 程序集

如果 VB 应用程序从未直接引用 MyReferencedAssembly 的功能,它是否需要 ComVisible?

谢谢!

4

1 回答 1

3

You shouldn't have to make MyReferencedAssembly ComVisible unless you use types from MyReferencedAssembly in the public signatures of MyComVisibleApi. Public signatures include properties, method parameters and return types.

There is also a special case: if you derive a ComVisible type from a type that is not ComVisible, public base class members will be exposed to COM as members of the derived class unless those members are individually [ComVisible(false)].

于 2010-01-15T20:33:31.657 回答