Does ServicePointManager.Expect100Continue = false remain set application-wide after setting it once?

StackOverflow https://stackoverflow.com/questions/21701470

I have the following code:

ServicePointManager.Expect100Continue = false;

on my main windows form frmMain_Load event. I have many forms and classes where different web services are called but these are always called after completion of frmMain_Load event.

So, ServicePointManager.Expect100Continue will remain as set in all web service calls in all forms and classes? or do I have to set it to false on every web service call?

It is .NET 2.0 desktop application in C#.

Note: I am sorry I posted such a dumb question. I can check in debugger by setting a watch on that value.

没有正确的解决方案

其他提示

Probably not the answer. but you can set the expect100Continue value to your App.Config. Setting this will be applied to the all web service call. you don't need to set it on each webservice call separately.

put it inside Configuration->system.net->settings

  <system.net>
    <settings>
      <servicePointManager expect100Continue="false"/>
    </settings>
  </system.net>

Note: Do not change this settings unless you decided to ignore the TCP 100Continue response result.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top