1

I am using the XMLSerializerClass of the Arcobjects SDK to serialize graphic elements of page layout into XML then saving the XML string to the database.

My issue is that when serializing graphics with symbols other than simple (e.g. Cartographic lines) it gives a runtime exception with a message (Value does not fall within the expected range.) I need help on solving this and how to serialize the scale text and elements other than text and graphics.

Here is my code by the way it is the same as the snippet found at ESRI website:

    internal static string Serialize(object element)
    {
        if (element == null)
            return null;

        XMLSerializerClass xmlSerializer = null;
        string xml = "";
        try
        {
            xmlSerializer = new XMLSerializerClass();

            xml = xmlSerializer.SaveToString(element, null, null);
        }
        finally
        {
            if (xmlSerializer != null)
                Marshal.FinalReleaseComObject(xmlSerializer);
        }
        return xml;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.