I have the following classes:
public abstract class BaseClass1 {}
public class ConcreteClass1 : BaseClass1 {}
public abstract class BaseClass2 : BaseClass1 {}
public class ConcreteClass2 : BaseClass2 {}
A WCF Service exposes 2 methods:
public ConcreteClass1 Method1() {...}
public ConcreteClass2 Method2() {...}
When "consuming" this WCF service with VS2012, the WCF client code correctly returns my "shared" ConcreteClass1 but for some reason, insists on generating a PROXY class for ConcreteClass2?
I don't understand why (even though I ALWAYS mark that I want to use ALL shared assemblies) sometimes it generates proxy classes for me and sometimes it does what I ask. I don't think I've ever seen it generate proxy classes for some of the types in an assembly, but not others.
I'm Totally confused!
Any help would be greatly appreciated...
I have ran into this problem as well. Sometimes turning all ALL shared assemblies off and updating the service and then turning all assemblies on and updating the service worked. Also...Picking specific assemblies was a lot less buggy. It was easier for me to write my own proxy class that way I could have it generate the code I wanted.
I found a good discussion about it here: WCF and Shared Reference Library Between Client & Service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With