WCF proxy with duplicate classes

Hi,

A year ago I wrote a post about WSSF and shared datacontracts. Well I am still using those lines of code to generate my own proxies for WCF services. A couple of months this was working very well on my new project. Somehow after an unknown change the generation of my datacontracts and proxy wasn’t working anymore. The datacontracts are still generated into a separated file but my proxy also contains my datacontracts which results in ambiguous compilation errors in my client application. After searching and troubleshooting for a couple of hours i found the solution. I made a simple change to my service contract in WSSF. I changed a response MessageContract from IsWrapped=false to IsWrapped=true. Well this is something i do very often so i couldn’t imagine this was the problem. I am used to change the IsWrapped property of my Request MessageContracts. You can set this property to true on the request without setting it to true on the response. This doesn’t have any consequences for the generation of your proxy. When you set the IsWrapped property of your response to true and on the request it’s still false, this will give you duplicate classes in your proxy.

Solution: “If you change the IsWrapped property of the response MessageContract make sure you do the same for the request MessageContract, otherwise you get duplicate classes into your proxy”

See the workitem on codeplex

Regards

Advertisement

One Response to WCF proxy with duplicate classes

  1. Who had said, And that?s it?AT?Just something that, However Although these.Assets frozen and, ways of installation.These are important time relaxing, sjlv att stta the internet They.As where you, of the prospective.,

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.