Tuesday, July 19, 2005

XML Serializer Fix for Visual Studio 2005 Beta 2

For those interested, Microsoft introduced a bug with beta 2 which results in the following error:



"If one class in the class hierarchy uses explicit sequencing feature (Order), then its base class and all derived classes have to do the same."



As it turns out, the bug is fixed in the July CTP, but there is no "go live" license support for the CTP. The interim fix was stated at: http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=55034. Using that post as a guideline, I added System.Xml.Serialization to the using commands, then added the [XmlElement] entry to every property in my object model.



/// <summary>

/// Sets/Gets Test

/// </summary>

/// <value></value>

[XmlElement(ElementName = "Test", Order = 1)]

public int Test

{

    set { _test = value; }

    get { return _test; }

}



This fix hasn't solved all my beta 2 problems, but it is a very major step in the right direction. Good luck for those others out there doing the same.

No comments: