generating cs file

C

csharpula csharp

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!
 
T

thomasnguyencom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top