Saturday, March 01, 2008 2:14 PM
Hi, when i try to use svcutil to generate a client, reusing types i get this error:
Command line:Code SnippetC:\Proyectos\DotNet\TFS\Juridico\Main\Source\Desktop\ConMega.Juridico.Presentati
on\ConMega.Juridico.Presentation\Service References>svcutil /r:c:\Proyectos\DotN
Error:Code SnippetError: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.Se
Error: Referenced type 'ConMega.Juridico.Base.EstructuraAbogado, ConMega.Juridic
o.Base, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null' with data contrac
t name 'EstructuraAbogado' in namespace 'http://schemas.datacontract.org/2004/07
/ConMega.Juridico.Base' cannot be used since it does not match imported DataCont
ract. Need to exclude this type from referenced types.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
How can i find in wich way "does not match imported DataContract", the type is defined once in a only assembly..
If i remove te references option in svcutil command line the error goes away and files are generates, but types arent reused...
Where i can find the XSD file?
Any help please ?
Wednesday, July 09, 2008 7:34 PMHave you ever resolved this issue?
Wednesday, July 09, 2008 10:03 PM
The error occurs because the data contract defined by the complexType in the xsd file does not match the class defined in the code file.
Could you paste a snippet of the complexType and class definition that you're having a problem with?
Wednesday, July 09, 2008 10:09 PMI have just installed .net framework 3.5 SP1 beta and now everything works fine.
Monday, February 09, 2009 7:38 PMSome times the visual studio says it is unable to refresh the dll based on the .dll.refresh files. if you delete the refresh files or change the patch in the refresh files, then things will work ok.sometimes I just close the solution and visual studio and reopen the solution in studio update the web service reference, then things work.I dont know the actual cause, but it is really wasting time and frustrating.
Thursday, July 23, 2009 11:13 AMI also had this problem. The problem for me was that I used a Generic class with the IsReference=True. My WCF Service returned this class and there was the problem. So for more information about this problem I have written an article on my blog. http://www.amkohartman.nl/post/2009/07/23/Adding-Service-Reference-results-in-empty-Referencecs(Referencevb).aspx
Hope that this helps solving somebody's problem.