开发者

In WPF projects, how to prevent WCF requests to be serviced by the UI thread?

开发者 https://www.devze.com 2023-03-23 06:06 出处:网络
Long delays in my W开发者_运维百科CF service implementation are blocking my WPF UI. When I make the methods run in a new thread the problem is solved, but I can\'t answer my clients synchronously this

Long delays in my W开发者_运维百科CF service implementation are blocking my WPF UI. When I make the methods run in a new thread the problem is solved, but I can't answer my clients synchronously this way. I think WCF is using the UI thread. How to prevent this?


Try to decorate your WPF Hosted WCF Service with

[ServiceBehavior(UseSynchronizationContext=false)]
0

精彩评论

暂无评论...
验证码 换一张
取 消