On Mar 30, 8:11 am, csharpula csharp <csharp...@yahoo.comwrote:
Hello,
I need to generate cs files from XSD files. I would like to do it
automatically. What is the best way to do it? Is it better be done with
PreBuild inside VS (before compilation) or to activate this action
outside of VS in extrenal script (and not on each compilation)?
Thank you!
*** Sent via Developersdexhttp://www.developersdex.com***
It depends on how often you plan on changing the XSD file.
-If the file generates and compiles new *.cs files at runtime, use an
external script. This will help avoid attaching the *.csproj file in a
production environment which is a huge no-no.
-If you're generating a one-time *.cs file, do so at build-time, I'd
suggest keeping it in the pre-build script. Yeah, you'll be generating
and compiling it every time, but you'll avoid moving any source files
into a production environment. In case the XSD changes, your build
reflects them automatically instead of having someone know to generate
the *.cs file every time the XSD changes.
goodluck
-tom