locked
how to debug reflections in System.Xml.dll ? RRS feed

  • Question

  • Hello, 

    i face a problem when using open source xsd2code plugin.

    It crashes in System.Xml.dll with an exception "System.InvalidOperationException"  

    There was an error reflecting type 'DriveTest.ISO15745Profile'.

    Can please somebody give me a hint how to debug reflections ?

    <background_A>

    The structure of the XSD is quite complex.

    Therefore I choose xsd2code and not xsd.exe or XSDObjectGen.exe because I want to use generics.

    </background_A>

    <background_B>

    I successfully tested xsd2code with a simple costumer-list application, based on a xsd schema. 

    So I expect the environment setup (V3.4,WinXpSP3, VS2008express,C#,.Net35) to be o.k.

    Then I tried to generate class code from a quite complex xsd schema.

    ( This so called "ISO15745Profile" xsd is part of an ISO standard. For this reason we have to take it as unchangeable.

    And there seem to be no need to do this, because we already used the xsd to generate Java classes. that run.)

    C# Code generation done by xsd2code works without any problem.

    The problem is, that the line "serializer = new System.Xml.Serialization.XmlSerializer(typeof(ISO15745Profile));" 

    from the generated code

            private static System.Xml.Serialization.XmlSerializer Serializer

            {

                get

                {

                    if ((serializer == null))

                    {

                        serializer = new System.Xml.Serialization.XmlSerializer(typeof(ISO15745Profile));

                    }

                    return serializer;

                }

            }

    crashes with the error code mentioned above.

    </background_B>

    Any hint is welcome.

    Thanks in advance.

    rainer
    alias BeakersBestFriend 
    • Moved by Robert Breitenhofer Wednesday, March 23, 2011 10:43 AM English instead German (From:Visual C#)
    • Moved by Leo Liu - MSFT Wednesday, April 6, 2011 3:33 AM Off-topic (From:Visual C# General)
    Saturday, March 12, 2011 9:40 AM

Answers

  • Hi,

    As you are dealing with a third-party plugin, your thread is off-topic here in the current forum.
    I'd like to suggest that you post your thread in some third-party communities or forums about this plugin for better support, the XML, System.Xml, MSXML and XmlLite is an alternative.
    I am moving your thread into the Off-Topic Forum shortly. Thanks for your understanding.
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 6, 2011 3:32 AM
  • Or I can move it into a specific forum for you if you'd like.

    This is regarding your code:

    private static System.Xml.Serialization.XmlSerializer Serializer
    
            {
    
                get
    
                {
    
                    if ((serializer == null))
    
                    {
    
                        serializer = new System.Xml.Serialization.XmlSerializer(typeof(ISO15745Profile));
    
                    }
    
                    return serializer;
    
                }
    
            }
    
    crashes with the error code mentioned above.
    
    </background_B>
    
    

    Thanks!


    Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)
    Thursday, December 22, 2011 2:06 PM

All replies

  • Hi,

    As you are dealing with a third-party plugin, your thread is off-topic here in the current forum.
    I'd like to suggest that you post your thread in some third-party communities or forums about this plugin for better support, the XML, System.Xml, MSXML and XmlLite is an alternative.
    I am moving your thread into the Off-Topic Forum shortly. Thanks for your understanding.
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 6, 2011 3:32 AM
  • Or I can move it into a specific forum for you if you'd like.

    This is regarding your code:

    private static System.Xml.Serialization.XmlSerializer Serializer
    
            {
    
                get
    
                {
    
                    if ((serializer == null))
    
                    {
    
                        serializer = new System.Xml.Serialization.XmlSerializer(typeof(ISO15745Profile));
    
                    }
    
                    return serializer;
    
                }
    
            }
    
    crashes with the error code mentioned above.
    
    </background_B>
    
    

    Thanks!


    Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)
    Thursday, December 22, 2011 2:06 PM