Home > Cannot Serialize > Cannot Serialize Interface System.collections.ienumerable

Cannot Serialize Interface System.collections.ienumerable

I have changed all my IList's to List's to see if that would do anything, but it didnt, infact, it didnt even take a second to load after making those changes, Cannot serialize interface System.Collections.Gene... ► 2013 (2) ► December (1) ► March (1) ► 2012 (8) ► August (2) ► June (1) ► May (2) ► April (1) ► March (2) We have to make sure to put [XmlIgnore] attributes on the properties that should NOT be serialized. As a quick check: does it work if you return Employee[] or List instead of IEnumerable ? –Marc Gravell♦ Jul 3 '14 at 10:23 Which web method from your http://sauvblog.com/cannot-serialize/cannot-serialize-interface-system-collections-generic-ienumerable.html

Saturday, May 17, 2008 9:00 PM 0 Sign in to vote There's no point in arguing about this. Otherwise, I think you will need to have the method signatures modified as DJ KRAZE suggested. –Chris Feb 1 '12 at 22:13 add a comment| up vote 3 down vote To Could you please needful for above issue. Saturday, May 17, 2008 7:32 PM 0 Sign in to vote The job of the serializer is to serialize and deserialize objects. http://stackoverflow.com/questions/9102234/xmlserializer-wont-serialize-ienumerable

Finding the max cost from the minimum cost incurred on travelling more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info Hot Network Questions Why is looping over find's output bad practice? You will not be able to do it with the XML serializer. –Joe Feb 1 '12 at 20:04 You'll have to use a different serializer. Normally, I would just use a System.Collections.Generic.List instead, but, what I'm trying to serialize is a domain object that I use with NHibernate.

Optional Password I have read and agree to the Terms of Service and Privacy Policy Please subscribe me to the CodeProject newsletters Submit your solution! Otherwise, you should use ReadOnlyCollection share|improve this answer answered Apr 28 '10 at 13:39 James 50.5k1290160 add a comment| Your Answer draft saved draft discarded Sign up or log in Share a link to this question via email, Google+, Twitter, or Facebook. First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone.

Is Area of a circle always irrational Where does \thepage kick in? Or, can you pass the logging to a middleman class that can turn any IEnumerables into Lists before passing it along to the Serializer? Total distance traveled when visiting all rational numbers Is privacy compromised when sharing SHA-1 hashed URLs? Read More Here Browse other questions tagged c# xml-serialization xmlserializer or ask your own question.

In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms What is the total sum of the cardinalities of all subsets of a set? Not the answer you're looking for? I think maybe you need to talk to the Java web service folks also because support for generic interfaces in their "bad design" has always worked.

Saturday, May 17, 2008 7:45 PM Moderator 0 Sign in to vote If the job of the serializer was to just serialize and deserialize, then it would have a problem with share|improve this answer answered Feb 14 '12 at 15:47 Sina Iravanian 10.1k31538 add a comment| up vote -1 down vote You can use DataContractSerializer using (var ms = new MemoryStream()) { And it fais anyone who assumes that this is a good design.   As an experiment, I tried the "read-only IList" case, but tried something non-trivial with it:   Code Snippet Finding the max cost from the minimum cost incurred on travelling What is with the speech audience?

Default value for date field How can I declare independence from the United States and start my own micro nation? http://sauvblog.com/cannot-serialize/cannot-serialize-interface-system-collections-generic-ilist-1.html Also, may want to consider the ShouldSerialize* pattern. The solution, then, is to give it a concrete instance to serialize. Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies

At a minimum, I'd like to have the ability to catch the error ala OnUnknownElement/Attribute to perform custom handling but right now, I tend to use a custom serializer (that functions more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Can I use that to take out what he owes me? this content more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

Why do languages require parenthesis around expressions when used with "if" and "while"? MyObject myObject = new MyObject() { Name = "My Name" , Numbers= new List(){"One", "Two"} }; var xmlSerializer = XmlSerializer.FromTypes(new[] { typeof(MyObject) })[0]; using (var xmlWriter = XmlWriter.Create(@"MyObject.xml")) { if (xmlWriter On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization.

Underbrace under nested square roots Why does low frequency RFID have a short read range?

The second would serialize a string.   When it's time to deserialize, how would a caller know which class had been serialized? Powered by Blogger. Please review the stack trace for more information about the error and where it originated in the code. c# asp.net kendo-ui share|improve this question asked Jul 3 '14 at 10:18 MR.alaa 457 3 Is there an inner-exception on that?

Is this a design flaw that the IEnumerable interface cannot be serialized? How to be Recommended to be a Sitecore MVP Why won't curl download this link when a browser will? See Trademarks or appropriate markings. have a peek at these guys If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.Would you like to participate?

Your Email Password Forgot your password? By default only the system primitive types and arrays of these primitive types (like int, float, double, string) can be used. 2.If you want to use your own classes as parameters The nicer solution is to write a surrogate class (i.e. Also, I'm aware that WinFX (yeah, that's right, I'm calling it WinFX ) includes its own serializers, but the catch with those is that those require dependencies to WCF/WPF (same gripe

UI for ASP.NET AJAX Resources Buy Try Feed for this thread 2 posts, 0 answers Kushan Shah 15 posts Member since: Jul 2006 Posted 30 Dec 2010 Link to this post Can you tell from reading the code? DataContractSerializer does not support interfaces in general, Try converting the ICollection to List.