Calling Element default constructor resuls in 'Object reference not set to an object instance' Exception

When using an xs:anyType in your XSD schema...

<xs:element name="MyAnyType" type="xs:anyType" />

...the code generator represents this using the generic Element type.

The Element type default constructor should not be used from inside your client code, otherwise 'Object reference not set to an object instance' Exception is raised.

The default constructor is for internal serialization use only. You should use one of the other constructors in order to provide a name for your Element, e.g. 

MyElement elm = new LiquidTechnologies.Runtime.Net20.Element("MyAnyType");

 

Add Feedback