none
ServiceBehaviorAttribute.MaxItemsInObjectGraph - items or bytes? RRS feed

Answers

  • Hi,

    As it described in the document, MaxItemsInObjectGraph sets a limit on the number of items in an object graph, and from my understanding, "The default is 65536 bytes" means by default the maximum number of items allowed in an object is 65536.

    Best Regards. 


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 19, 2013 3:25 AM
    Moderator

All replies

  • Hi,

    As it described in the document, MaxItemsInObjectGraph sets a limit on the number of items in an object graph, and from my understanding, "The default is 65536 bytes" means by default the maximum number of items allowed in an object is 65536.

    Best Regards. 


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 19, 2013 3:25 AM
    Moderator
  • I am still confused. Number of items and number of bytes are two different things. And I do not think I understand your explanation of 65536. Can you be more specific?

    And going back to my original question: is it items or bytes?

    Friday, April 19, 2013 4:35 PM
  • Hi,

    It is number of items. You can set it( with System.Int32 type) to a larger value, the max value you can set is 2,147,483,647. From my experience and other cognitive developers, it is a habit of saying to describe a number with byte. To confirm this, you can try leave a comment at the end of page of the document.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Saturday, April 20, 2013 2:48 AM
    Moderator
  • Has the default value changed between 4.0 and 4.5? I have a service that works on .NET 4.5 but fails on .NET 4.0. Increasing the value fixes the problem on .NET 4.0.

    Saturday, April 20, 2013 10:59 PM
  • Looks like in .NET 4.5 the default of ServiceBehaviorAttribute.MaxItemsInObjectGraph was changed from 65536 to 2147483647, but documentation has not been updated.

    Or has this change been unintended and is actually a bug?

    Sunday, April 21, 2013 12:09 AM
  • Hi,

    >>Has the default value changed between 4.0 and 4.5? I have a service that works on .NET 4.5 but fails on .NET 4.0. Increasing the value fixes the problem on .NET 4.0.

    I do not find any document state that the default value has been changed. I'd suggest you submit a feedback with a reproduce project for this issue at Microsoft connect site. Thanks.

    https://connect.microsoft.com/

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 23, 2013 1:25 AM
    Moderator