I am trying to automate our build. Different environements would have different set of values for the properties in the config file. What are my options if I am using msbuild?
Properties can be set externally on the command line (check out the /p option of MSBuild). When you change which system a build is done on or for, just set a property externally (i.e. have a batch file that invokes msbuild on the solution file and sets your property), then inside the msbuild file you can check the value of that property and change the build behaviour accordingly.
I did not mean msbuild properties. For example if I have different database connection string etc which I would like to set in the config file for different evnironment. Then I was going to have one feeder file which stores all the different environment settings in msbuild xml format, and then have a batch file or something populate the actual config file with the values based on the environment. The question then is about this batch file, any ideas on this. I guess I could write a msbuild task to accomplish this, but I was hoping there was native msbuild way to do it. Thanks