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

How to generate C# classes from an XSD file?
novice programmerAsked:
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 -
https://docs.microsoft.com/en-us/dotnet/standard/serialization/xml-schema-def-tool-gen

Pls let us know if you asking some thing else.
0
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.
0

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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

novice programmerAuthor 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.
0
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?
1
novice programmerAuthor 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
0
Dirk StraussSenior Full Stack DeveloperCommented:
1
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.