Bala
Bala

Reputation: 45

While updating service reference i get error HRESULT E_FAIL has been returned from a call to a COM component

I have created a restful wcf service there are GET methods already exist. But when in interface I created post method like

[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "createDemo")]
int createDemo(ObjectInfo obj);

I consumed this service in another asp.net website project, while updating service over there i get the "HRESULT E_FAIL has been returned from a call to a COM component" error. Now if I comment this post method from service interface. Service reference gets updated. I googled for the same but i didn't understand what is causing the issue?

Upvotes: 3

Views: 4603

Answers (1)

Shibu Thomas
Shibu Thomas

Reputation: 3196

Start—>Run—> regsvr32  %SystemRoot%\System32\msxml3.dll

Start—>Run—> regsvr32  %SystemRoot%\SysWOW64\msxml3.dll

Or

Delete the project Cache from the below location:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

This is for Microsoft Visual Studio 2010

Please go through this link for more details..

http://blogs.msdn.com/b/smondal/archive/2013/03/08/error-hresult-e-fail-has-been-returned-from-a-call-to-a-com-component.aspx

Hope it will help you.

Also Could you try the following:
Clean the project and rebuild it.
Close the project go to its folder location and delete the bin and obj folders.
Make sure that the references assemblies in the project are located in the same location. To do so expand the References in the project and check each assemblies Path in the properties window.

For Microsoft Visual Studio 2013, I suggest that you could try to delete the project cache which path likes:

C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplatesCache

C:\Program Files(x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplatesCache

Then run "devenv.exe /setup" to re-build the cache.

Start—>Run—> C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe  /setup

Upvotes: 1

Related Questions