Home > There Was > There Was An Error While Trying To Serialize Parameter Enum

There Was An Error While Trying To Serialize Parameter Enum

In the server side call, certain conditions caused a new object to be created, but the fact that the default value for the enum property was 0, we weren't setting it, and I immediately got an exception with HELPFUL information this time round: "There was an error while trying to serialize parameter http://tempuri.org/:data. Not giving me more information though. This could also be due to an HTTP request context being aborted by th e server (possibly due to the service shutting down). click site

You can assign any value to an enum (within the range of the underlying type); for example: enum Foo { Bar = 1 } ... I started from scratch, deleted all my files, got latest version from TFS, did a rebuild and the problem was solved. c# wcf share|improve this question asked May 25 '13 at 17:51 Arsen Zahray 6,7482384147 check if the enum value appears in the service WSDL (or one of its referenced In the Activity tab on the far left we immediately notice that one of the activities is highlighted in red. https://social.msdn.microsoft.com/Forums/vstudio/en-US/b9672bc6-5707-42e6-b6ce-621df78b037d/using-enum-in-return-types-with-datacontract?forum=wcf

Monday, June 07, 2010 6:56 PM Reply | Quote 0 Sign in to vote Just want to record my findings in case it'll help someone. Browse other questions tagged c# wcf datacontractserializer or ask your own question. First, the server-side configuration file in WcfConsoleHost: Not the answer you're looking for?

Well the problem is that if we pass false to WcfClient.Program.DisplayMyCompositeObject (and hence to WcfClient.Program.GetMyCompositeType and hence to WcfServiceLibrary.Service1.GetMyCompositeType), to ask that an uninitialised instance of MyCompositeObject be returned, we get Why is value 3 a problem? Is it Possible to Write Straight Eights in 12/8 How do really talented people in academia think about people who are less capable than them? We update both configuration files to add the following within the element: We then direct the messages to an appropriate listener

Finding if two sets are equal Why were Navajo code talkers used during WW2? Clicking this text populates the panel in the bottom-right with details of the exception. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. http://stackoverflow.com/questions/16752334/wcf-service-doesnt-accept-new-member-to-the-enum cs:line 48 at WcfClient.Program.DisplayMyCompositeObject(Boolean initialised) in C:\User s\Ian.Picknell\Documents\Blog\WCF\Serialising Enumerations with WCF\WcfClient\Pr ogram.cs:line 23 at WcfClient.Program.Main(String[] args) in C:\Users\Ian.Picknell\Documents\B log\WCF\Serialising Enumerations with WCF\WcfClient\Program.cs:line 11 I've highlighted what I believe to be the

Why is the FBI making such a big deal out Hillary Clinton's private email server? This could also be due to an HTTP request context being aborted by th e server (possibly due to the service shutting down). This is a 'Process action' activity for 'http://tempuri.org/IService1/GetMyCompositeType'. Try as we may, logical (to us) debugging wasn't coming up with anything fruitful, so trial-and-error methods started taking place.

Why does Deep Space Nine spin? Please see InnerException for more details. Alternatively just tell us what you think!

Web Development ASP.NET Quickstart Programming news Java programming ASP.NET tutorials C# programming Developer Jobs ASP.NET Jobs Java Jobs Developer Jobs Our tools We've I have a black eye.

We couldn't quite pin-point or blame any code that we were looking at. Now I added a new member to the enum: [DataContract] enum MyEnum { [EnumMember]Member1, [EnumMember]Member2, [EnumMember]Member4, [EnumMember]Member3 } And again, updated the client through MEX endpoint. The problem manifested itself in a System.ServiceModel.CommunicationException being thrown with nothing particularly useful in the Exception message itself. I have a black eye.

Thursday, July 30, 2009 2:54 AM Reply | Quote 0 Sign in to vote Could you please enable tracing (http://msdn.microsoft.com/en-us/library/ms733025.aspx) to find more info on the issue?.Regards,Rodrigo. Because even if you get the old service reference you can call the method with your new enum value since it exists in your solution and it might use the enum public class MyObjectDTO { public int Id { get; set; } public int Size { get; set; } public LPFProcessor Processor { get; set; } public LPFAccess Access { get; set; Always ensure that your enumerations support 0, even if you map that to something generic like Unknown or Undefined.

How to apply for UK visit visa after four refusal Are assignments in the condition part of conditionals a bad practice? Stainless Steel Fasteners Finding if two sets are equal Huge bug involving MultinormalDistribution? Can you try adding values to Front and Rear? –Tomislav Markovski Jan 18 '12 at 16:27 What is the value it is receiving?

Firing up WcfClient the gives us a nice simple: MyBool=True MyString=Hello World MyString=Male So what's the problem?

does that sound right? –asawyer Jan 18 '12 at 16:48 1 @asawyer whether that is "right" is up to you; if that is what you want a -1 to do, Then used the variables to implement certain features on my asp.net pages and all was working well on my local machine until I tried to move the changes to the web Chat with Support Chat with our experienced staff to receive help right away. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.

Thank you though. –asawyer Jan 18 '12 at 16:41 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Solution: The solution is pretty simple, just keep a good programming habit, initialize everything before using it, and when defining the properties, the definitions should contain the fallback values, such as It's a shame that WCF doesn't propagate the above exception to the client, especially as I've set includeExceptionDetailInFaults to true in my server-side configuration file. But the client will receive the error: 'comminucationexecption occured' :: 'There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).' I have traced the error to