views:

42

answers:

4

So I've got several projects in a solution. A couple of class librarys, a UI, and several testing projects.

There is a set of XML files that are used to store alot of configuration information that we need to init our app.

I want to have one place that is THE xml files and then copy that set of XML into the different projects when they get built. Does anyone know what best practices might address this issue? A tutorial or blog post would be great.

Thanks

A: 

You can place the files in a directory along side your projects. E.g \lib Then in the post build step for the individual projects. E.g. xcopy ..\lib\file1.xml ($OutputDir)

pattersonc
+2  A: 

You can use Build event command lines (Project / Properties / Build Events) to copy the XML from the source to the project directory before (or after) compilation.

Nestor
A: 

Something like this might do it.

emptyset
hmmm, that's not exactly what I'm looking for.The XMLs described alot of different options and are already read in by the exsisting code.I'm looking to move them into source code to maintain them and also so that the tests will automatically use the latest versions.
Joel Barsotti
That's what the article is hinting at. You can add an app.config file to each project, have a custom attribute that references the location of the XML files you need. The app.config files would be in source control, you can put the XML files anywhere, and updating each spot where the projects use a given XML file is just a simple replace to look at the custom attribute.
emptyset
A: 

What revision control are you using? It's possible to set the xml files up, version them and then set them up as dependencies for your repository as well. This way when you check out the new project, the new dependencies (unless ignored) will be pulled down with the project.


On second thought, it looks like you're looking to copy them in at build, thus that wouldn't be ideal for you. Though I would imagine you could add a build event to export from the repository so you're always grabbing the latest copy?

thismat
currently the company is still using Visual Source Safe 2005, I"m going to try to get them to Team Foundadtion Server, since they are a Microsoft Shop.SCM = software configuration management, right?
Joel Barsotti
Sorry, I'll edit that, I was thinking revision control.
thismat