如何使用支持的Outlook代码安装窗口服务 [英] How to install window service with supported outlook code

查看:79
本文介绍了如何使用支持的Outlook代码安装窗口服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows服务,我们正在从我的Outlook阅读邮件并插入数据库。它在调试模式下工作正常,并且记录插入也很好。我们曾经在Windows中创建安装程序和托管服务。它给出了错误。请在下面找到错误详情。



服务无法启动。 System.Runtime.InteropServices.COMException(0x80080005):由于以下错误,检索CLSID为{0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:80080005服务器执行失败(HRESULT异常:0x80080005(CO_E_SERVER_EXEC_FAILURE) ))。



如果评论的Outlook服务也运行正常,没有任何问题。




我的尝试:



如果评论的outlook服务也运行正常,没有任何问题。

I have one windows service where we are reading mails from my outlook and inserting into database. It is working fine in Debug mode and records also inserting fine. Where as once we have created installer and hosted service in windows. it is giving error. Please find the error details below.

Service cannot be started. System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

If commented outlook service is also running fine without any issues.


What I have tried:

If commented outlook service is also running fine without any issues.

推荐答案

使用Outlook interop在用作服务时需要登录用户,因此要么在普通用户帐户下运行您的服务(不推荐

或以另一种方式做事。
Using Outlook interop requires a logged in user when used as a service, so either run your service under a normal user account (which is not recommended)
or look into doing things another way.


这篇关于如何使用支持的Outlook代码安装窗口服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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