Is there T4 templates available for generating c# classes from xsd?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not that I know of, but take a look at LINQ to XSD (http://linqtoxsd.codeplex.com/). You can use LinqToXsd.exe to generate strongly typed classes based on your schema. And then you have full LINQ support as well. Very handy.
You could also set up a pre-build event on your project that looks something like:
"$(ProjectDir)Lib/LinqToXsd/LinqToXsd.Exe" "$(ProjectDir)MySchema.xsd" /fileName:MySchema.csAnd that would generate the classes from the schema right before you build, so if you change your schema, your classes will stay in sync with each build.