C# 为什么RegistrationServices.RegisterAssembly()返回FALSE?

C# 为什么RegistrationServices.RegisterAssembly()返回FALSE?,c#,.net,com,C#,.net,Com,我编写此代码是为了向COM接口注册我的程序集: var rs = new RegistrationServices(); var b = rs.RegisterAssembly(Assembly.GetExecutingAssembly(), AssemblyRegistrationFlags.Se

我编写此代码是为了向COM接口注册我的程序集:

var rs = new RegistrationServices();
var b = rs.RegisterAssembly(Assembly.GetExecutingAssembly(),                                                                                                     AssemblyRegistrationFlags.SetCodeBase);
执行结束时b等于false。我不明白我做错了什么?有没有办法获得更多关于注册失败原因的信息


谢谢大家!

在没有更多信息的情况下,我们所能做的就是从“如果程序集不包含符合条件的类型,则为false”中指向“程序集不包含符合条件的类型”。-是否存在符合条件的类型?符合条件的类型是用[ComVisible(true)]属性修饰并具有默认构造函数的类型。首先做Reasas.EXE工作,然后考虑这样做。