Home > Cannot Be > Type Cannot Be Serialized. Consider Marking It With The Datacontractattribute

Type Cannot Be Serialized. Consider Marking It With The Datacontractattribute

Contents

Does Intel sell CPUs in ribbons? Why were pre-election polls and forecast models so wrong about Donald Trump? Many thanks. –Tom Redfern Nov 6 '12 at 7:57 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Hot Network Questions What Could Cause Flash Over / Arcing to Reappear on New Plugs? Source

Consider marking it with the DataContractAttribute attribute up vote 0 down vote favorite I have a Web API and I'm just trying to return some data to the calling client in As a monk, can I use Deflect Missiles to protect my ally? The structure of IJob is like this: IJob (Interface) - JobBase (Abstract class) - JobA (Driven from JobBase) - JobB (Driven from JobBase) c# wcf serialization exception-handling datacontract share|improve this question US Election results 2016: What went wrong with prediction models? http://stackoverflow.com/questions/10077121/datacontract-exception-cannot-be-serialized

Type '' Cannot Be Serialized Wcf

Assembler for CPU Does calling a function that mutates static local variables twice in the same expression lead to undefined behavior? If the type is a collection, consider marking it with the CollectionDataContractAttribute. What do you call the practice of using (overly) complex words specific to a subject? I believe you also need to convert those fields to properties.

  1. up vote 1 down vote favorite Trying to pass "complex" class type that contains primitive types with interfaces and lists of interfaces/classes.
  2. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.
  3. Is there an actual army in 1984?
  4. How can I claim compensation?
  5. Check your error message.
  6. Vent kitchen hood vent to roof turbine vent?

Browse other questions tagged c# wcf serialization exception-handling datacontract or ask your own question. Browse other questions tagged c# serialization asp.net-web-api asp.net-web-api2 or ask your own question. Not the answer you're looking for? Datacontract Namespace How can I accurately cross-cut a board that is too wide for my table saw?

QGIS Print composer scale problems What is this line of counties voting for the Democratic party in the 2016 elections? System Runtime Serialization Datacontract Furniture name for waist-high floor-sitting shelf cabinet thing straight lines + point of intersection in TikZ Straight line equation What episode of Star Trek is this creature on? If the type is a collection, consider marking it with the CollectionDataContractAttribute. How good should one be to participate in PS?

Boss sends a birthday message. Datacontractjsonserializer C# TBB updating metadata value Safety - Improve braking power in wet conditions Does calling a function that mutates static local variables twice in the same expression lead to undefined behavior? My AccountSearchMapsYouTubePlayNewsGmailDriveCalendarGoogle+TranslatePhotosMoreShoppingWalletFinanceDocsBooksBloggerContactsHangoutsEven more from GoogleSign inHidden fieldsSearch for groups or messages My cat sat on my laptop, now the right side of my keyboard types the wrong characters TIKZ: foreach not compatible with calc-library?

System Runtime Serialization Datacontract

Not the answer you're looking for? I don't have access to it, that's why I had to overload it in the first place. –lxa Dec 16 '13 at 14:11 1 in that case, I strongly suggest Type '' Cannot Be Serialized Wcf How does Gandalf end up on the roof of Isengard? Collectiondatacontractattribute The serializer having problem figuring out how to serialize that member, so here is the solution: When using interface as a member (or list of interface) in a class that is

share|improve this answer answered Dec 10 '12 at 23:52 Thraka 1,148619 Thanks for clear answer :) –Jakub Kučera Apr 19 at 15:12 add a comment| up vote 1 down this contact form Given the hints solve the puzzle Lab colleague uses cracked software. How to prove that authentication system works, and that the customer is using the wrong password? Does an Eldritch Knight's war magic allow Extra Attacks? Web Api Anonymous Type Cannot Be Serialized

What i'm doing wrong?2Type 'MyDTO' cannot be serialized - Wcf Service1Type 'System.Threading.Tasks.Task`1[FundingReportData[]]' cannot be serialized1Nested DataContract serialization exception WCF1InvalidDataContractException (“Type cannot be serialized”) error using WCF DataContract0Type 'Infragistics.Windows.Controls.SpecialFilterOperands+OperandWrapper' cannot be serialized Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. This could be due to the service endpoint binding not using the HTTP protocol. have a peek here Would the members of an online imageboard (or any community) be able to build a post-apocalytic society upon their reputation?

Why were pre-election polls and forecast models so wrong about Donald Trump? Datacontractserializer share|improve this answer edited Nov 6 '12 at 8:29 answered Nov 6 '12 at 7:48 Eli Livshitz 111127 dang, 6 minutes too late :( –Kristof Nov 6 '12 at All rights reserved.

You will also want to place the DataMember attribute above any properties you will want to make available through the service as well as OperationContract above any methods you want to

OBDII across the world? Should I report it? it had a bunch of missing data... What i'm doing wrong?1WCF Client not consuming user-defined datatype from Web Service (SCVTrace included)1Nested DataContract serialization exception WCF0Windows Phone 8.1 Suspend1WCF InvalidDataContractException: “Type cannot be serialized” but is marked correctly1Web API

Please 'Mark as Answer' if this post helped you. How to reply? Browse other questions tagged c# asp.net-mvc asp.net-web-api entity-framework-5 or ask your own question. Check This Out If the type is a collection, consider marking it with the CollectionDataContractAttribute.

My cat sat on my laptop, now the right side of my keyboard types the wrong characters In the context of this quote, how many 'chips/sockets' do personal computers contain? Join them; it only takes a minute: Sign up DataContract runtime error - Type 'myType' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. You need to add: [DataContract] public class Occupant { // *** Needed only for Serialization public Occupant() {} ...

TSA broke a lock for which they have a master key. The descriptive error from MS Service Trace Viewer (SvcTraceViewer): Type 'myType' cannot be serialized. Privacy Statement| Terms of Use| Contact Us| Advertise With Us| CMS by Umbraco| Hosted on Microsoft Azure Feedback on ASP.NET| File Bugs| Support Lifecycle To use Google Groups Discussions, please 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

Thanks. And yes again, locks should not be used within DataMember type properties. –Eli Livshitz Nov 6 '12 at 7:49 add a comment| 1 Answer 1 active oldest votes up vote 2 How do you enchant items with Lapis Luzuli? So either: don't use the base-class - use a simple DTO that doesn't need it, or: mark the base-class for serialization Specifically, something like: [DataContract, KnownType(PhysicalAddressSerializable)] public class PhysicalAddress { [DataMember(...)]