0

I am trying to make a class of my project serializable so I can exchange objects of it throgh a network for a client/server-application.

Since I also want to include "child"-objects and private members I chose to do so with the help of DataContractSerializer.

However, although I am layzily trying to copy-paste my first draft out of MSDN's respective site, do not get good results. I already referenced the System.Runtime.Serialization.dll as well as all the related namespaces.

Here's my issue: When trying to compile I get

CS0535 'Server.Anfrage' does not implement interface member 'System.Runtime.Serialization.IExtensibleDataObject.ExtensionData' (CS0535)

although I got my the specified member implemented. For now I am only trying to get it to work with the 3 strings, but later it's going to be more.

[DataContract]
public class Anfrage : IExtensibleDataObject
{

    [DataMember]
    internal string sender, aktion, param;


    internal halbAuftrag execute(){

        Bahnhof von = Program.bahnhoefe[Program.getIndex(sender)];
        Bahnhof zu = Program.bahnhoefe[Program.getIndex(param)];

        return new halbAuftrag(von, aktion, zu);
    }

    internal ExtensionDataObject extensionData_Value;

    public ExtensionDataObject extensionData {

        get {
            return extensionData_Value;
        }

        set {
            extensionData_Value = value;
        }
    }
[...]
}

Can anyone tell me why I am getting the aforementioned error? Thanks a lot.

Mark
  • 419
  • 1
  • 6
  • 21

1 Answers1

0

You have a small typo. The following line

public ExtensionDataObject extensionData {

Should be

public ExtensionDataObject ExtensionData {

(capital E)

Eli Arbel
  • 22,391
  • 3
  • 45
  • 71
  • http://files.sa-mp.im/uploads/6434e-Epic%2520facepalm-b7.jpg Thanks! I read half the c#-doc to find it: I should have known that it'll be something stupid :D – Mark Jan 10 '14 at 05:50