Custom tool warning: Cannot import wsdl:portType / wsdl:binding ! [Solution]

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.

Steps-

  • Right click on Service References and select ‘add service reference…’ option. Now click on Advanced button.

advanced

  • Now uncheck the ‘reuse types in reference assemblies’ option and click on OK.

uncheck

  • Now add the service reference.

Service reference should be added without any error/warnings.

Please like, share and comment.

Thanks for checking out !

Categories
Comments
All comments.
Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.