Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using Microsoft.Office.Interop.Outlook. i followed all the steps as you mention above but i don't get any success.
following are the server information:
IIS 7
Windows 2008 server.
i am receiving the following error:
Server Error in '/' Application.

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.

Source Error:

Line 19:     protected void btnCalender2_Click(object sender, EventArgs e)
Line 20:     {
Line 21:         _Application olApp = (_Application)new Application();
Line 22:         NameSpace mapiNS = olApp.GetNamespace("MAPI");
Line 23:
Posted
Updated 11-Oct-12 20:20pm
v2
Comments
Sergey Alexandrovich Kryukov 12-Oct-12 18:19pm    
Well, as it says: please review the stack trace, it will show you the call stack which originally thrown the exception.
--SA

Please see my comment to the question. The simplest way of look at the stack trace is this: System.Exception.StackTrace:
http://msdn.microsoft.com/en-us/library/system.exception.stacktrace.aspx[^].

Looking at System.Exception.InnerException (recursively) may also help, please see below. See:
http://msdn.microsoft.com/en-us/library/system.exception.innerexception.aspx[^].

It's enough to catch all exceptions only once per thread, on top stack frame of the stack of each thread. But it does not mean that it always help to resolve a problem, because some exceptions could be caught down the stack with their propagation blocked, simply by not re-throwing such exceptions. If this is your code, try to avoid it. In some cases, this is acceptable, then log the exception information:
http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx[^].

One special case of blocking propagation could be re-throwing a different exception (a different type or a different instance). In particular, it could be re-thrown in a different thread. The usual practice is to "pack" the original exception in InnerException; that's why I noted its importance above.

Please takes these measures to get further information on your problem. For now, based on your information, that's all I can advise.

—SA
 
Share this answer
 
Hello,

Your error details:

HRESULT: 0x80080005 (2148007941)
Name: CO_E_SERVER_EXEC_FAILURE
Description: n/a
Severity code: Failed
Facility Code: FACILITY_WINDOWS (8)
Error Code: 0x0005 (5)

Actually I think that simplify that Outlook isn't installed on that system or installed different version.
Anyway, check for COM object with CLSID is registred or not.
Anothir thing is you creating "Application" object - which can be System.Windows.Forms.Application or your Outlook appllication - try to specify full object path in that stament to outlook interop.

Regards,
Maxim.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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