WCF REST Service: InstanceContextMode.PerCall 不管用,无法实现并发

Since the service is controlled by a GUI, the "UseSynchronizationContext" attribute was needed to solve the problem:

[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,UseSynchronizationContext=false)]


现在开发很多WCf程序已经不托管在IIS下,而是自托管了,所以在客户访问服务时,如果不进行如上设置 ,无法实现真正多的多线程,造成访问排队。

 
原文地址:https://www.cnblogs.com/babietongtianta/p/3042623.html