Original Post
Hey everyone, I'm new here so sorry if I mess things up (hello to all of you btw
). I have a weird problem. I have been making this web service no problem for the past couple of days. I had to use a custom dictionary (code below) to serialize my dictionaries (holding serialized class objects). I made some minor function additions to the web service, went to recompile and BAM visual studio turned all of my SerializableDictionary classes (in function parameters, so for example public void AddMethod(SerialzableDictionary data) would read in the object browser public void AddMethod(DataSet data)) into DataSets
Also I can no longer access the SerializableDictionary class from the client (the object browser just does not show it). I can see the class inside of the web service namespace. I also can load the IL DASM and it shows the class in the web service dll just fine?! So I am confused...I have tried re-creating the web service, restarting my computer/visual studio, to no avail.
Here is the custom dictionary class used to serialize dictionary data across the web service.
Here is the picture of the il dasm seeing the class (I have highlighted it).
http://tinypic.com/r/2a8qioh/5 <----------- couldn't embed I tried sorry
Any help is much appreciated! Thanks everyone!
Here is the custom dictionary class used to serialize dictionary data across the web service.
[XmlRoot("dictionary")]
public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IXmlSerializable
{
#region IXmlSerializable Members
public System.Xml.Schema.XmlSchema GetSchema()
{
return null;
}
public void ReadXml(System.Xml.XmlReader reader)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
bool wasEmpty = reader.IsEmptyElement;
reader.Read();
if (wasEmpty)
return;
while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
{
reader.ReadStartElement("item");
reader.ReadStartElement("key");
TKey key = (TKey)keySerializer.Deserialize(reader);
reader.ReadEndElement();
reader.ReadStartElement("value");
TValue value = (TValue)valueSerializer.Deserialize(reader);
reader.ReadEndElement();
this.Add(key, value);
reader.ReadEndElement();
reader.MoveToContent();
}
reader.ReadEndElement();
}
public void WriteXml(System.Xml.XmlWriter writer)
{
XmlSerializer keySerializer = new XmlSerializer(typeof(TKey));
XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));
foreach (TKey key in this.Keys)
{
writer.WriteStartElement("item");
writer.WriteStartElement("key");
keySerializer.Serialize(writer, key);
writer.WriteEndElement();
writer.WriteStartElement("value");
TValue value = this[key];
valueSerializer.Serialize(writer, value);
writer.WriteEndElement();
writer.WriteEndElement();
}
}
#endregion
}
Here is the picture of the il dasm seeing the class (I have highlighted it).
http://tinypic.com/r/2a8qioh/5 <----------- couldn't embed I tried sorry
Any help is much appreciated! Thanks everyone!