异常详细信息:System.Runtime.InteropServices.COMException:由于以下错误,检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:... [英] 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:...

查看:127
本文介绍了异常详细信息:System.Runtime.InteropServices.COMException:由于以下错误,检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft.Office.Interop.Outlook.我遵循了您上面提到的所有步骤,但没有成功.
以下是服务器信息:
IIS 7
Windows 2008服务器.
我收到以下错误:

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:

推荐答案

请参阅我对问题的评论.查看堆栈跟踪的最简单方法是:System.Exception.StackTrace:
http://msdn.microsoft.com/en-us/library/system.exception. stacktrace.aspx [ ^ ].

(递归)查看System.Exception.InnerException可能也有帮助,请参阅下文.参见:
http://msdn.microsoft.com/en-us/library/system.exception. innerexception.aspx [ ^ ].

在每个线程的堆栈的顶部堆栈帧中,每个线程仅捕获一次所有的异常就足够了.但这并不意味着它总是有助于解决问题,因为某些异常可以通过不重新抛出此类异常而在其传播被阻止的情况下捕获到堆栈中.如果这是您的代码,请尝试避免使用它.在某些情况下,这是可以接受的,然后记录异常信息:
http://msdn.microsoft.com/en-us/library/system.diagnostics. eventlog.aspx [ ^ ].

阻止传播的一种特殊情况可能是重新引发不同的异常(不同的类型或不同的实例).特别是,可以将其重新抛出到其他线程中.通常的做法是在InnerException中打包"原始异常.这就是为什么我在上面指出其重要性的原因.
请采取这些措施以获得有关您的问题的更多信息.目前,根据您的信息,我可以提供所有建议.

—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


您好,

您的错误详细信息:

HRESULT:0x80080005(2148007941)
名称:CO_E_SERVER_EXEC_FAILURE
说明:n/a
严重性代码:失败
设施代码:FACILITY_WINDOWS(8)
错误代码:0x0005(5)

实际上,我认为简化一下是未在该系统上安装Outlook或未安装其他版本.
无论如何,请检查是否已注册具有CLSID的COM对象.
另一件事是您创建应用程序"对象-可以是System.Windows.Forms.Application或您的Outlook应用-尝试在指向Outlook互操作的那部分中指定完整的对象路径.

问候,
Maxim.
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.


这篇关于异常详细信息:System.Runtime.InteropServices.COMException:由于以下错误,检索具有CLSID {0006F03A-0000-0000-C000-000000000046}的组件的COM类工厂失败:...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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