By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,571 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,571 IT Pros & Developers. It's quick & easy.

generating cs file

P: n/a

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 Developersdex http://www.developersdex.com ***
Mar 30 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Mar 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.