Tuesday, December 27, 2016

Maximum number of items that can be serialized or deserialized in an object graph is '65536- Office365

During the generating the Office 365 users license report, i got following PowerShell error:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://provisioning.microsoftonline.com/:ListUsersResult. The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '. Please see InnerException for more details.


Solution

Every WCF service comes with its own bindings, behaviors and other preferences, applying appropriate changes requires of every single WCF service. We can change .NET Framework configuration globally for your system. This solution should permanently solve problem for all applications using WCF services.

We need to modify the machine.config -files, please follow the below steps:

Check your powershell version with $psversiontable.psversion.tostring()

Move to folder that corresponds your powershell version C:\Windows\Microsoft.NET\Framework*\*\CONFIG



Modify machine.config., Add below line


Most of case it will resolve the issues, if not reboot the server.

Happy Learning!

Thanks.

No comments:

Post a Comment