none
Xsd.exe class generation for Metro style apps

    Pregunta

  • We are attempting to generate C# classes using xsd.exe and some xml schemas.  The code generated does not compile for Metro style applications, because of the [SerializableAttribute] which is not available in .NET for Metro apps.  Is there/will there be a Metro compatible version of xsd.exe or some other tool to generate code from schemas?  Is it safe to simply remove the [SerializableAttribute] from the generated code and use that in a Metro style app?

    lunes, 16 de abril de 2012 21:18

Todas las respuestas

  • hi,

    Mabye the XML, System.Xml, MSXML and XmlLite forum is the correct for you.

    jueves, 19 de abril de 2012 7:46
  • I'm in the same position as Ari.

    Below is an example of the attributes on a partial class created from an XSD using xsd.exe

    The compiler isn't happy with the SerializableAttribute() and the DesignerCategoryAttribute() lines.

    Any advice on how to amend the .cs file would be appreciated. (DataContext?)

    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://Submission")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace="http://Submission", IsNullable=false)]
    public partial class UnsanitisedSubmission {

    • Editado RD8388 lunes, 05 de agosto de 2013 16:04 moved question above code
    lunes, 05 de agosto de 2013 16:02