Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 10-Sep-16 19:48pm
Comments
Garth J Lancaster 11-Sep-16 1:27am    
What exactly do you mean by 'debug mode' (ie, working fine in ...) ? do you mean you are running it In Visual Studio (I usually set Services up so that they run as a console type application in VS/Debug mode) ...

What account/credentials are you using to run the service in in production mode ? a 'real user' or one of the system accounts ?

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900