Was getting the following error while adding a WCF service reference to an MVC application-
Custom tool warning: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name=''] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='']
I had used the same service reference in other applications but never got this error. Finally the solution that worked was to uncheck the ‘reuse types in reference assemblies’ in the advance menu while adding service reference.
- Right click on Service References and select ‘add service reference…’ option. Now click on Advanced button.
- Now uncheck the ‘reuse types in reference assemblies’ option and click on OK.
- Now add the service reference.
Service reference should be added without any error/warnings.
Please like, share and comment.
Thanks for checking out !