{"id":4842,"date":"2014-03-30T15:54:27","date_gmt":"2014-03-30T15:54:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/serialization-exception-in-net-system-invalidoperationexception-you-must-implement-a-default-accessor-on-system-collections-generic-stack1-collection-of-common-programming-errors\/"},"modified":"2014-03-30T15:54:27","modified_gmt":"2014-03-30T15:54:27","slug":"serialization-exception-in-net-system-invalidoperationexception-you-must-implement-a-default-accessor-on-system-collections-generic-stack1-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/serialization-exception-in-net-system-invalidoperationexception-you-must-implement-a-default-accessor-on-system-collections-generic-stack1-collection-of-common-programming-errors\/","title":{"rendered":"Serialization exception in .NET: System.InvalidOperationException: You must implement a default accessor on System.Collections.Generic.Stack`1-Collection of common programming errors"},"content":{"rendered":"<p>All I am trying to do is<\/p>\n<pre><code>XmlSerializer serializer = new XmlSerializer(typeof(Stack));\n<\/code><\/pre>\n<p>and I get the following at runtime:<\/p>\n<p><code>System.InvalidOperationException<\/code>: You must implement a default accessor on <code>System.Collections.Generic.Stack<\/code>`1 [[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] because it inherits from ICollection.<\/p>\n<p>Am I not supposed to serialize the <code>Stack<\/code>?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All I am trying to do is XmlSerializer serializer = new XmlSerializer(typeof(Stack)); and I get the following at runtime: System.InvalidOperationException: You must implement a default accessor on System.Collections.Generic.Stack`1 [[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] because it inherits from ICollection. Am I not supposed to serialize the Stack?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4842","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4842"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4842\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}