generate classes from an XSD file for serialization in .net C#

How to generate C# classes from an XSD file?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
You have provided very less info. Assuming you are asking about xml schema definition tool. ??

You can use xsd.exe tool to generate classes.

steps you can follow from -

Pls let us know if you asking some thing else.
Dirk StraussSenior Full Stack DeveloperCommented:
This sounds a lot like something we had to do a couple of years back for SYSPRO Business Object XML files. Have a look at the Microsoft article How to: Use the XML Schema Definition Tool to Generate Classes and XML Schema Documents.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

mikhaAuthor Commented:
Thanks everyone. I tried the XSD tool and got a huge file written back with all the classes. I guess, if we want the each class to be in own file, I will have to do that manually.
Dirk StraussSenior Full Stack DeveloperCommented:
I would be interested to see what you supplied the tool with and what it generated. I'm not sure if it worked out for you, because having to manually break the file up to create the classes in their own files seems like a lot of work. Is it possible that the XSD can be simplified to produce a smaller file with the tool?
mikhaAuthor Commented:
@Dirk - that's what I'm wondering. I ran the following command.
I have a xLink.xsd and schema.xsd file , passed in as parameter and it gave be back  xLinkABCSchema.cs file.

> Xsd xLinkABC.xsd  ABCschema.xsd  /classes
Dirk StraussSenior Full Stack DeveloperCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.