简体   繁体   English

WCF代理类......有时候?

[英]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: WCF服务公开了两种方法:

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? 当使用VS2012“使用”此WCF服务时,WCF客户端代码正确返回我的“共享”ConcreteClass1但由于某种原因,坚持为ConcreteClass2生成PROXY类?

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 我在这里找到了一个很好的讨论: WCF和客户端与服务之间的共享参考库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM