Failed to generte code for the Service reference + WCF
I am getting the following error :
Error 1 Reference.svcmap: Failed to generate code for the service reference 'ServiceReference'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Referenced type 'KWI.CLUE.Auto.DataContracts.CLUEResult, KWI.CLUE.Auto.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'CLUEResult' in namespace 'http://schemas.datacontract.org/2004/07/KWI.CLUE.Auto.DataContracts' cannot be us开发者_如何学编程ed since it does not match imported DataContract. Need to exclude this type from referenced types.In order to resolve this issue : In the Configure Service Reference, clicked the Advanced button. Then chose "Reuse types in specified referenced assemblies". And unchecked KWI.CLUE.Auto.Contracts.
Now it works fine but when I am trying to access the client as below :
ServiceReference.CPServiceClient clueProcessingClient = new ServiceReference.CPServiceClient();
I am not able to see the methods of KWI.CLUE.Auto.Contracts. which is the correct behaviour.
Now is there another way to resolve this issue other than what I did.
Thanks in advance BB
精彩评论