最佳答案
假设这是一个 ServiceContract
[ServiceContract]
public interface MyService
{
[OperationContract]
int Sum(int x, int y);
[OperationContract]
int Sum(double x, double y);
}
方法重载在 C # 中是允许的,但是 WCF 不允许您重载 operation contracts
托管程序将抛出一个 InvalidOperationException
而托管