HRESULT E_FAIL Error when adding a service reference to a wcf service in visual studio

653 views Asked by At

I have a WCF service hosted by a windows service via net.tcp.

I know this service works, because when I use svcUtil, I can generate client code to consume the service without a problem.

When I try to add a reference to the service via Visual Studio 2013, and enter the address for the service (net.tcp://localhost:9000/BankingService/mex), and click "go" the service shows up in the service explorer, and all of its operations are visible.

However, when I click "OK", to add the service reference, I get a dialog saying :

Error:

HRESULT_FAIL has been returned from a call to a COM component.

(not very descriptive. and there appears to be no log that can clarify the meaning of this error anywhere)

No service reference is made, and I have no clue what is going on.

Is this Visual Studio "giving up", or is there something I might missed somewhere?

Is there a solution to this problem?

1

There are 1 answers

0
Timothy Groote On BEST ANSWER

In my case, a third party mechanism (in this case slow-cheetah) had moved the web.config of the project that i wanted to add the service reference to.

Visual studio gave a terribly unhelpful error message and simply gave up.

For now, moving the web.config back to where it would be by default is the solution.