Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Proxy Classes ... sometimes?

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...

like image 216
eejai42 Avatar asked Nov 13 '22 08:11

eejai42


1 Answers

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

like image 102
Kenneth Parker Avatar answered Nov 15 '22 07:11

Kenneth Parker