- Category: ASP.Net
- Published on Tuesday, 25 November 2008 15:05
- Written by Shabdar
- Hits: 30348
The server method failed with the following error: System.InvalidOperationException-- Maximum length exceeded.
Everything works fine until the web service returns a larger number of objects.
Go to your Web.Config file. Add following sections if they don't exist under <configuration>
As you can see above I have set maxJsonLength="5000000" in jsonSerialization section. This solves maximum length exceeded error.