Programmatically set WCF timeout in debug mode

后端 未结 2 1299
遥遥无期
遥遥无期 2021-02-06 00:50

I\'m using WCF in communication between a server and client (both written in C#).

In release-mode, the timouts should be set to ~20 seconds, but in debug mode I want to

2条回答
  •  感情败类
    2021-02-06 01:27

    You can create a second binding in the web.config and set a longer sendTimeout.

            if (debug)
            {
                proxy =  new MyClient("WSHttpBinding_MyLocal");
            }
            else
            {
                proxy = new MyClient("WSHttpBinding_MyDev");
            }
    
            
                

    ...

提交回复
热议问题