检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败 [英] Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed

查看:425
本文介绍了检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在 .Net  4 中创建了Windows服务。< span class =code-digit> 5  .Service  写入打开的Outlook客户端,从读取电子邮件收件箱文件夹,下载附件。编写的代码 正确,因为我已经运行&在控制台应用程序项目中测试了它。但是 我使用 安装Web服务 >  installutil并运行它,该服务在以下代码行上抛出以下错误:

Outlook.Application myApp = new Outlook.Application();

错误:

检索COM factory 失败: 80010001 被叫方拒绝了呼叫。 (例外来自 HRESULT:0x80010001(RPC_E_CALL_REJECTED))检索COM factory for 组件失败: 80010001 被叫方拒绝了呼叫。 (例外来自 HRESULT:0x80010001(RPC_E_CALL_REJECTED))。

仅供参考,服务 未在我的机器上运行,我觉得该服务可能需要一些权限, if 所以请我知道如何为Windows服务分配权限。





我尝试过:



此处代码: -



Outlook.Application myApp = new Outlook.Application(); Outlook.NameSpace mapiNameSpace = myApp.GetNamespace(MAPI); ns = myApp.GetNamespace(MAPI);



错误: -

检索具有CLSID {0006F03A-的组件的COM类工厂0000-0000-C000-000000000046}由于以下错误而失败:80010001被叫方拒绝了呼叫。 (来自HRESULT的异常:0x80010001(RPC_E_CALL_REJECTED))由于以下错误,检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:80010001被调用者拒绝了调用。 (来自HRESULT的异常:0x80010001(RPC_E_CALL_REJECTED))

解决方案

是否在计算机上安装了Outlook?对于它的价值,你不会让它工作,Outlook不适合没有交互式桌面的环境中的自动化。如果Outlook需要显示对话框或提示或错误会发生什么?当无法看到警报时,谁会点击确定?当您的服务将作为系统或类似的东西而不是交互式用户运行时,究竟是谁将使用Outlook的帐户?



如果您需要提供这些服务的服务事情然后自动化Outlook是错误的方法,你应该模仿 Outlook而使用POP3 \IMAP和SMTP来实现你想要的东西,或者如果你使用Exchange则使用Exchange Web服务

I have created windows service in .Net 4.5.Service is written to open outlook client, read emails from Inbox folder, downloads attachments.The code written is correct, since I have run & tested it in console application project. But when I install the web service using "installutil" and run it, the service throws following error on following line of code:

Outlook.Application myApp = new Outlook.Application();

Error:

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)).

FYI, the service is not running on my machine,I feel that service might require some permission, if so please let me know how to assign permissions to windows service.



What I have tried:

Code here :-

Outlook.Application myApp = new Outlook.Application(); Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI"); ns = myApp.GetNamespace("MAPI");

Error :-
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

解决方案

Is Outlook installed on the machine? For what it's worth, you're not going to get this working, Outlook is not suitable for automation from environments that have no interactive desktop. What happens if Outlook needs to show a dialogue box or prompt or error? Who is going to click "ok" when the alert can't be seen? Exactly whose account is Outlook going to use when your service will be running as system or something like that and not the interactive user?

If you need a service that does these things then automating Outlook is the wrong way to go, you should be emulating Outlook instead and using POP3\IMAP and SMTP to achieve the things you want, or use Exchange Web Services if you're using Exchange.


这篇关于检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆