Monday, January 12, 2009

Custom tool warning: cannot import wsdl:portType

I chased this bug for a while - more and more frustrated... This was what happened: I updated a WCF Service Reference and got this error (or actually warning) in the Error List of Visual Studio. Also I saw that the Reference.vb was totally empty.

OK - after some trying of my own (why do I do that over and over? Don't think - steal from others...) I though of searching the Net and of course found the answer in five seconds.

Here is a guy that solved it - but the header and description of the post is quite different so I'll try to give my own explanation here.

In the Configure Service Reference... dialog box there is an option "Reuse types in referenced assemblies". Exactly what that means is hard to grasp (just try for yourselves) - but I understand it as the tool tries to download the assemblies that the service is referencing.

The solution, however, don't have much to do with understanding that (if you don't want to) - simply clear that box and regenerate. It works!

9 comments:

Kevin Rohling said...

Thank you, you are the man! This was driving me crazy! Such a simple fix too lol

Marcus Hammarberg said...

At your service. My good! I was going crazy with this, I remember

Anonymous said...

Thanks a lot. It made me crazy as well.

Britney Spears said...

Markus, you are my hero. I was this close to chuck my laptop out of the window!

Yours,
Britney

Janet said...

Awesome! I feel like I owe you lunch or something. Thanks!

Tom said...

You saved me hours!

Öjvind Otterbjörk said...

Gogglade på "Custom tool warning: Cannot import wsdl:portType" från min warninglist i Visual Studio och fick din sida som första träff! Kul!!

Ännu roligare att det löste vårt problem!!

SUPER!!!!

Norm said...

Good, god. This fixed it. Had this bug bug in every instance of the bing maps services, this fixed all four. Thank you so much!!!!!!

priyadarshi said...

Thanks Marcus.This really brought an end to a hard day.