我尝试按照文章_1226304中的说明进行操作,并在我的C#应用程序中实现了IUCOfficeIntegration接口,并希望它与Outlook 2010一起使用 . 我创建了一个C#Exe,通过在官方示例How to develop an out-of-process COM component by using Visual C++, Visual C#, or Visual Basic .NET上创建代码来注册COM Interop的类 .

当我运行C#COM服务器时,我能够使用以下代码从另一个C#应用程序实例化注册的类:

Guid clsid = new Guid("394376DD-3BB8-4804-8CCC-9559434004F3");
 Type t = Type.GetTypeFromCLSID(clsid, true);
 object i = Activator.CreateInstance(t);

当COM服务器不运行时,我按预期得到错误 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG) .

我启用了Outlook Presence Logging,启动了C#COM Server设置注册表项,但Outlook无法实例化我的COM类,即使C#Test应用程序可以执行此操作 .

在Outlook日志中,我得到错误行:

hr = 80040154, We couldn't identify the provider type we now try to manually CoCreate using the LCClient CLSID

我检查了注册表项,但它们是正确的 . 由于一些未知的原因,它不起作用 . 文档称Outlook将使用CoCreateInstance和CLSID来实例化该类 . 有没有人有一个想法可能是错的 . 有没有人得到这个工作?