开发者

Failed to generte code for the Service reference + WCF

开发者 https://www.devze.com 2023-03-01 09:19 出处:网络
I am getting the following error : Error1Reference.svcmap: Failed to generate code for the service reference \'ServiceReference\'.Cannot import wsdl:portTypeDetail: An exception was thrown while runni

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号