What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType" What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType" wpf wpf

What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType"


I found my answer here: http://www.lukepuplett.com/2010/07/note-to-self-don-let-wcf-svcutil-reuse.html

Long story short: I unchecked Reuse types in reference assemblies from the Advanced menu.


I don't know if this matters but i'm not using MVC, but Web Forms.


When you add a service reference, there are two ways the types that are used by the service can be handled:

  • The types are stored in a dll, and that dll is referenced from both the client and the server application.
  • The types are not in a dll referenced by the client. In that case the tool that creates the service reference, will create the types in the references.cs file.

There are many things that can go wrong. We have found that if the tool crashes, it is sometimes faster to delete the service reference and start again.

We have stopped using service reference. For projects where we have control of the client and the service, we use the method described in this screencast.


I also had this issue Today. It took me one entire day to find my mistake. Hope it helps.

My class that weren't able to be imported has a cutom enum type property. This property is marked as DataMember and the Enum is also marked as DataContract. Everything fine so far.I just forgot to mark every enum member as EnumMember.

So i changed

[DataContract]public enum SortMethodType{    Default = 0,    Popularity = 1,    ReleaseDate = 2,    PublishedDate = 3,    TranslatedTitle = 4,    OriginalTitle = 5,    UserRating = 6,    Duration = 7}

To this:

[DataContract]public enum SortMethodType{    [EnumMember]    Default = 0,    [EnumMember]    Popularity = 1,    [EnumMember]    ReleaseDate = 2,    [EnumMember]    PublishedDate = 3,    [EnumMember]    TranslatedTitle = 4,    [EnumMember]    OriginalTitle = 5,    [EnumMember]    UserRating = 6,    [EnumMember]    Duration = 7}

And it finally worked!