RPC_E_SERVERFAULT

2020-03-21 10:40发布

In my asp.net application I am calling one com component method using Interop dll. This is working fine in normal condition but In production sometimes its throwing below exception

System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

I am suspecting that this is happening when large number of users are accessing same page simultaneously.

Is somebody know solution or steps to debug this issue.

I have another question. while searching on internet I came across this aspcompact attribute and MTA vs STA thread model related to com components . Is this aspcompact attribute is applicable in case of interop dll(Runtime callable wrappers). Will adding this attribute will solve my problem?

标签: asp.net com
5条回答
干净又极端
2楼-- · 2020-03-21 10:50

Monitor your site to capture exception when it raise.

Use Debug Diagnostics Tool v1.2

With the generated dump is easier to identify the point of failure.

查看更多
可以哭但决不认输i
3楼-- · 2020-03-21 10:54

I had the same problem, but I got it to work by adding a [STAThread] attribute to the Main function.

[STAThread]
static void Main(string[] args)
查看更多
Root(大扎)
4楼-- · 2020-03-21 10:55

Also could mean the COM object crashed. Try to rerun the application represented by the COM object by itself and see if it crashes or produces some error.

查看更多
啃猪蹄的小仙女
5楼-- · 2020-03-21 10:59

RPC_E_SERVERFAULT means that the out-of-process COM server threw a structured (Win32)exception, which could be all sorts of things, such as an Access Violation, Divide by Zero, etc. In other words, there's a bug in the COM server's implementation and there's nothing you can do in your calling application to cure this (unless you can find out what the bug is and can design a way to call the COM component which doesn't execute the buggy code).

You need to find whichever of your colleagues is responsible for the COM server, get him/her to use the debugger to capture a crash dump when the exception occurs, then do post-mortem debugging on the dump to diagnose the problem and fix it.

查看更多
戒情不戒烟
6楼-- · 2020-03-21 11:11

I'm running Powershell scripts that use the MS Office 2010 Excel COM objects and started receiving this error. The culprit was the latest MS Office patches. Sorry, I can't specify exactly which one caused the error (I uninstalled a bunch at time), but uninstalling one of them solved the issues. The updates were installed on 7/18/2016.

查看更多
登录 后发表回答