System. runtime. interopservices. comexception (0x80004005): An error hresult e_fail is returned for calling the COM component.
After more than 10 hours, I finally solved the problem. Because I used the sta mode, I wrote log functions in various functions to replace tracking debugging.
The thread is being aborted at 13:51:12. Initcomobject ()
2002-1-6 13: 51: 52 before starun new webpreviewbase
2002-1-6 13: 51: 52webpreviewbase constructor No problem
13:51:52 go to getwebpreview ().
13:51:52 entering initcomobject () has not hung http://webpic.marlin.com.cn/
13:51:52 an error hresult e_fail was returned for calling COM components. Initcomobject ()
13:51:52 an error hresult e_fail was returned for calling COM components. 213
Finally, it is locked to the initcomobject () function.
Try
{
Commons. errorinfo. Log ("initcomobject () has not been mounted" + this. _ URI );
_ WB. navigate (this. _ URI); //
Commons. errorinfo. Log ("_ WB. navigate ()" + _ URI + "no ");
// This is required because there is no form
While (_ WB. readystate! = Webbrowserreadystate. Complete)
{
// Re-paint now
Application. doevents ();
}
// It is best to comment this sentence. Otherwise, no animation can be captured on the webpage.
// _ WB. Stop ();
If (_ WB. activexinstance = NULL) throw new exception ("instance cannot be blank ");
}
Catch (Exception ex)
{
Commons. errorinfo. Log (ex. Message+ "Initcomobject ()");
ThrowEx;
}
The strange thing is that the above error will be reported if you put it on the server without any problems locally.
The real reason is that I finally got caught at lunch today,
It is a problem with IIS. Just restart IISOK.
This is a simple problem, but it is also a very cold problem.
This problem occurs when the DLL of COM component or system. Windows is called on the web.