I have a Winforms application that exposes a WCF service.
From IIS, I try to consume the service. From 2 different computers I try to call test1.aspx
which in turn calls the WCF inside the Winforms app.
test1.aspx => from computer 1 => First Call
test1.aspx => from computer 2 => Second Call
I see that the WCF is single-threaded, and before it starts to process CALL 2 it needs to finish to process CALL 1.
[ServiceBehavior(IncludeExceptionDetailInFaults = true,
ConcurrencyMode=ConcurrencyMode.Multiple,
InstanceContextMode=InstanceContextMode.PerSession)]
I have Windows Server 2008 R2 and IIS 7.5
Can anyone help me?
WCF behaves differently when service is hosted in UI thread which is probably your case. By default WCF processing joins Windows message loop so request processing will not only become serial but it will also halt all event processing in WinForms UI (application will freeze).
To avoid this behavior you must explicitly say that you don't want to host service in UI thread:
[ServiceBehavior(UseSynchronizationContext = false)]
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