开发者

Duplicate classes in my wcf proxy

开发者 https://www.devze.com 2022-12-21 16:23 出处:网络
Okay, I have two OperationContracts and MessageContracts, like this: [OperationContract] OperationResult OperationOnSingleItem(Input input)

Okay, I have two OperationContracts and MessageContracts, like this:

[OperationContract]
OperationResult OperationOnSingleItem(Input input)

[OperationContract]
OperationResult OperationOnItemCollection(Inputs inputs)

[MessageContract]
public class Inputs
{
    [MessageBodyMember]
    Input[] InputCollection
}

[MessageContract]
public class Input
{
    ..............开发者_如何学编程.
    ...............
}

Now when I add this WCF service reference to a client, I see duplicate classes, both which correspond to the same Object Input.

i.e. in my client I can see ServiceReference.Input and another duplicate class called ServiceReference1.Input1.

Both have similar members, but i cant use the minterchangably since i get a type mismatch.

How do i stop the duplicate entries from being generated in the proxy.


Using svcutil from the command line, you can specify the location of the input class so that the duplicate class is not generated.

0

精彩评论

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