Search code examples
c#.netxmlserializerxsd.exeservice-reference

Generate C# from WSDL, without "Order"


I generate C# code from WSDL using "Service References" in Visual C# 2010 (see screenshot).

Generated code uses Order parameters, which makes me think that under the hood, Visual C# is performing is running xsd.exe /order, among other things. Example:

[System.Xml.Serialization.XmlElementAttribute(Order=1)]

Because of a Mono bug, I want to generate C# code WITHOUT Order parameters.
To do that with xsd.exe (XSD to C#), I would simply omit the /order parameter.

But how to generate Order-free code from a WSDL file?
Only the following settings seem to be available:

enter image description here


Solution

  • generate the code normally, then do a regex search and replace in VS.
    Replace all occurances of (Order=*)] with ]