Questions tagged [netdatacontractserializer]

44 questions
0
votes
2 answers

wcf netdatacontractserializer exception serialising idictionary with enumeration as key

I am using the NetDataContractSerialiser with WCF. This is working well with all our types being serialised. However, a service I am calling is generating the following exception The formatter threw an exception while trying to deserialize the…
Peter
  • 1
0
votes
1 answer

Dispose or not Dispose.. the writer created from XmlDocument thru navigator?

Do I really need to dispose the writer below? DataContractSerializer _serialier... var actual = new XmlDocument(); using (var writer = actual.CreateNavigator().AppendChild()) _serialier.WriteObject(writer, myObj); If not then the code is…
Schultz9999
  • 8,717
  • 8
  • 48
  • 87
0
votes
1 answer

VB.Net WCF Pass an array of class as a parameter to Client side

I have a WCF single channel implementation on the Server side and Client side. I have a custom class on the Server side that i am trying to pass to the client side. I am trying to pass an array (collection) of custom class to the client…
0
votes
1 answer

Force order in NetDataContractSerializer without using DataContractAttribute

I want to force the NetDataContractSerializer to write property values in a specific order, because the serializer writes them in an alphabetic order. I know I can achieve this by adding [DataMember(Order = X)] attributes to these properties but…
0
votes
2 answers

How to serialize type derived from ConfigurationSection with NetDataContractSerializer

I wrote my type derived from ConfigurationSection tagged all properties with DataMember and class with DataContract, however program crashes stating I cannot inherit my type from a type that is not marked with DataContract. So how could I use this…
astrowalker
  • 3,123
  • 3
  • 21
  • 40
0
votes
1 answer

AppFabric cache and serializing IQueryable objects

I am experimenting with AppFabric caching and have run into an issue with saving retrieved data in the cache. The root of the problem is that it seems that AppFabric Caching requires the data to have DataContract and Datamember attributes applied to…
rboarman
  • 8,248
  • 8
  • 57
  • 87
0
votes
1 answer

Is there a way to signalize an object its successful deserialization?

I'm using NetDataContractSerializer. After successfully deserializing an object, is there a way to tell the object to finish its construction? I'm thinking along the lines of: [DataContract] class Foo { [DataMember] int i; …
mafu
  • 31,798
  • 42
  • 154
  • 247
0
votes
1 answer

Selective serialization with NetDataContractSerializer

Serializing this class works fine. However, sometimes I'd like to exclude the field. Is this possible? [DataContract] class Foo { [DataMember] Foo _Foo; } Setting the field to null temporarily is impossible.
mafu
  • 31,798
  • 42
  • 154
  • 247
0
votes
1 answer

How would one serialize nested collections when using a custom ISerializationSurrogate?

I'm attempting to use a generic serialization surrogate to control the naming of fields that are serialized through use of the NetDataContractSerializer. The concept is working well so far except for that I'm running into a problem any time I…
jpierson
  • 16,435
  • 14
  • 105
  • 149
0
votes
0 answers

Error while deserializing the missing element

I am using NetDataContractSerializer for serialization/deserialization. I have serialized the dictionary which contains the Employee object Now I have changed Employee object and included boolean field IsManager So, after deserialzing above xml I…
0
votes
1 answer

protobuf-net as wcf serializer with object in OperationContract

I have project that uses wcf. Currently it uses NetDataContractSerializer. I want to migrate to protobuf-net. My service has folowing contract: interface IRemotingServer { [OperationContract] TypeConfig GetTypeConfig(string typename); …
Gor Rustamyan
  • 902
  • 10
  • 21
0
votes
2 answers

Serialization of enum with NetDataContractSerializer

I have the following: [Serializable] public class SimulationException : Exception { public SimulationExceptionStatusCode StatusCode { get; set; } public SimulationException() { } public SimulationException(string msg) : base(msg) …
Ori Price
  • 3,593
  • 2
  • 22
  • 37
0
votes
1 answer

NetDataContractSerializer produces invalid XML

My NetDataContractSerializer seems to be confused: The end of the XML appears twice:
Marc
  • 12,706
  • 7
  • 61
  • 97
-1
votes
1 answer

When net connection is on show a toast automatic

I want to created an app.if data connection is on then show a toast automatic. Otherwise not show. Im created many apps but i don't know how to make this. I try this but not work. public class MainActivity extends Activity { private WebView…
1 2
3