maxReceivedMessageSize and maxBufferSize in app.config

后端 未结 7 768
心在旅途
心在旅途 2020-12-16 09:30

How to increase maxReceivedMessageSize and maxBufferSize parameters in app.config file to 2000000 before running the application.

7条回答
  •  囚心锁ツ
    2020-12-16 09:50

    You can do that in your app.config. like that:

    maxReceivedMessageSize="2147483647" 
    

    (The max value is Int32.MaxValue )

    Or in Code:

    WSHttpBinding binding = new WSHttpBinding();
    binding.Name = "MyBinding";
    binding.MaxReceivedMessageSize = Int32.MaxValue;
    

    Note:

    If your service is open to the Wide world, think about security when you increase this value.

提交回复
热议问题