xsd.exe missing a "global::"

I need to generate C# classes from some existing .xsd files and one of the 
resulting classes unfortunately has a member called "System".  This breaks 
things further down in the same class where it tries to use 
"System.Xml.Schema.XmlSchemaForm.Qualified".  Manually adding a "global::" 
prefix fixes the problem, but it would be far preferable if I could get 
"xsd.exe /classes /fields ..." to do the right thing.  Is there some option 
or knob I'm missing somewhere?  Perhaps there is a later version of xsd.exe 
that doesn't have this problem (this one calls itself 2.0.50727.3038)?

Thanks.

Here's an excerpt from the resulting .cs file:

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/ovf/envelope/1")]
    [System.Xml.Serialization.XmlRootAttribute("VirtualHardwareSection", 
Namespace="http://schemas.dmtf.org/ovf/envelope/1", IsNullable=false)]
    public partial class VirtualHardwareSection_Type : Section_Type {
        
        /// <remarks/>
        public VSSD_Type System;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("Item")]
        public RASD_Type[] Item;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAnyElementAttribute()]
        public System.Xml.XmlElement[] Any;
        
        /// <remarks/>
        
[System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
        [System.ComponentModel.DefaultValueAttribute("")]
        public string transport;
        
        public VirtualHardwareSection_Type() {
            this.transport = "";
        }
    }
0
Henric (1)
10/8/2009 4:43:01 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
582 Views

Similar Articles

[PageSpeed] 52

Reply:

Similar Artilces:

xsd.exe missing a "global::"
I need to generate C# classes from some existing .xsd files and one of the resulting classes unfortunately has a member called "System". This breaks things further down in the same class where it tries to use "System.Xml.Schema.XmlSchemaForm.Qualified". Manually adding a "global::" prefix fixes the problem, but it would be far preferable if I could get "xsd.exe /classes /fields ..." to do the right thing. Is there some option or knob I'm missing somewhere? Perhaps there is a later version of xsd.exe that doesn't have this problem (this...