ist_lion
ist_lion

Reputation: 3209

xsd.exe C# file to XSD file

I have an XML file that I used to create an XSD File and from there generated the C# code.

However, during development I had to make some changes to that C# file. Is there a way I can use the xsd.exe tool to convert that C# file back into an XSD file? I'm hoping to avoid having to go and manually edit the XSD File.

Upvotes: 4

Views: 2261

Answers (1)

Ando
Ando

Reputation: 11409

From the C# file directly you cannot go back to the XSD file (not by using xsd.exe).

You can build back the schema from the type constructed in the C# file:

xsd.exe yourdll.dll /t[ype]:TypeYouWantASchemaFor or

xsd.exe yourExe.exe /t[ype]:TypeYouWantASchemaFor

See the DLL and EXE File Options section from the xsd documentation.

Upvotes: 4

Related Questions