# Payload size limitation in .Net

**URL:** https://talk.remobjects.com/t/payload-size-limitation-in-net/18182
**Category:** Remoting SDK
**Tags:** net
**Created:** [December 10, 2018, 2:42pm UTC](https://talk.remobjects.com/t/payload-size-limitation-in-net/18182 "2018-12-10T14:42:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jensw\_2000](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jensw_2000/32/159_2.png) [@jensw\_2000](https://talk.remobjects.com/u/jensw_2000)
#### Post date: [December 10, 2018, 2:42pm UTC](https://talk.remobjects.com/t/payload-size-limitation-in-net/18182/1 "2018-12-10T14:42:36Z")

</div>

I currently work on the replacement of a fairly old ROSDK Sevice-application - written in Delphi, about 10 years ago. The new one is written in C# using the current ROSDK to provide TLS, Authentication and the HTTP API.  
On testing I noticed, that I’m unable to call service-methods, when the whole payload is greater then 5 MB. The old Delphi version did’nt had this limitation.  
In my old service version it was possoble to send ComplexTypes with binary members up to 20-30 MB (never tested more). I have to provide this functionality in .Net too, because 5MB are definitely not enough for out customers. Also I have to keep the method-signatures of the old RODL, because we have a lot of customers with Non-ROSDK client implementations.

Long question - short: Where can I turn off the 5MB Limit of the Messages, Channels or underlaying connections or change it to 20MB for example?

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [December 10, 2018, 3:09pm UTC](https://talk.remobjects.com/t/payload-size-limitation-in-net/18182/2 "2018-12-10T15:09:15Z")

</div>

> [@jensw\_2000](#):
>
> Long question - short: Where can I turn off the 5MB Limit of the Messages, Channels or underlaying connections or change it to 20MB for example?

To start with, change the `MaxMessageSize` and `MaxDecompressedMessageSize` property values of the BinMessage used server-side.

IIRC you’re using the CodeFirst approach so the required code would look like

```
var message = new BinMessage();
message.MaxDecompressedMessageSize = Int32.MaxValue;
message.MaxMessageSize = Int32.MaxValue;
server.NetworkServer.RegisterServerMessage(message);

```

Some of the channels also have their own set of security options (as request size limitation purpose was to prevent server abuse):

- for `HttpSysChannel`, `IpTcpServerChannel` and `IpHttpServerChannel` it is `..SecurityOptions.MaxRequestSize`
- for `IpSuperHttpServerChannel` it is `MaxPackageSize`

> [@jensw\_2000](#):
>
> The old Delphi version did’nt had this limitation.

Unrelated: Remoting SDK for Delphi has the same set of size limitations. Most probably they are lifted in the Delphi app.

---

<div class="post-metadata">

### Author: ![jensw\_2000](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jensw_2000/32/159_2.png) [@jensw\_2000](https://talk.remobjects.com/u/jensw_2000)
#### Post date: [December 10, 2018, 3:53pm UTC](https://talk.remobjects.com/t/payload-size-limitation-in-net/18182/3 "2018-12-10T15:53:25Z")

</div>

Thank you. Is working fine …
