Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xsd.exe to generate classes as separate files?

I have a collection of .xsd files. When generating classes using xsd.exe, the output file is some ~17000 lines long with hundreds and hundreds of partial classes.

In the interest of neatness, is it possible for either xsd.exe or even visual studio (2010) to split these classes, each into a separate file?

like image 792
maxp Avatar asked Nov 29 '11 17:11

maxp


People also ask

What is XSD exe?

The XML Schema Definition (Xsd.exe) tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly.

What is the use of XSD file in C#?

XSD can easily define parent-child relationship and basic type restrictions needed to define tables - so can be used as database schema. "MSDataSetGenerator" is the "custom tool" that builds whatever files/binaries are needed from the XSD whenever XSD is saved.


1 Answers

I don't know of any possibility using xsd.exe or plain VS, but it is possible using ReSharper. Right-click on the file -> Refactor -> Move types into matching files.

like image 145
Daniel Hilgarth Avatar answered Oct 20 '22 15:10

Daniel Hilgarth