regasm RA0000:无类型登记类型、regasm

2023-09-03 01:34:01 作者:不曾记得你的好。

我有一个C ++ / CLI组件(编译.NET 3.5与Windows 7)。 该组件被标记为标记有ComVisible特性(真)。它包含2类和1接口。这两个类都被标记为标记有ComVisible特性(假)所以他们不应该的问题。接口上标有 InterfaceType(ComInterfaceType :: InterfaceIsIUnknown)和特定的GUID。这个接口需要注册

I have a C++/CLI assembly (compiled for .NET 3.5 that comes with Windows 7). The assembly is marked as ComVisible(true). It contains 2 classes and 1 interface. Both classes are marked as ComVisible(false) so they shouldn't matter. The interface is marked with InterfaceType(ComInterfaceType::InterfaceIsIUnknown) and a specific GUID. This interface needs to be registered.

当我尝试使用 RegAsm.exe AssemplyName 来注册这个组件,我得到这样的警告:

When I try to register this assembly using RegAsm.exe AssemplyName, I get this warning:

RegAsm : warning RA0000 : No types were registered

我的组件依赖于其他3个总成它们是在同一目录作为我的主要组件。其中2注册没有问题,第三个没有标记为标记有ComVisible特性

为什么我不能注册我组装任何想法?

Any ideas why I'm unable to register my assembly?

推荐答案

它看起来像组件没有被注册,因为它没有包含可以注册任何课程,只是一个接口。当我加入一个虚拟类来装配,警告消失了,组装得到了注册。

It looks like the assembly wasn't being registered because it didn't contain any classes available for registration, just the one interface. As soon as I added a dummy class to the assembly, the warning went away and the assembly got registered.