I have a few test environments where the new stuff deployed by hand and/or Release Manager. Beside these I have a different machine (test agent installed and it is hooked up to Test Manager) where I execute the automated test cases the. So, the environments under test and the environment where I execute the test cases are not the same.

The environment settings (db, user, url, etc.) are stored in the test project's web.config file. The problem I have now is that I have to make change in the web.config and check it in to TFS and wait for another build to run, etc. It is not comfortable and not effective.

Is there any other way to define the environments against which I would like to run my automated test cases and not creating new builds unnecessary?

Thanks for any help in advance!

  • Would web.config transforms help here? Dec 24, 2014 at 13:31
  • Absolutely! The next possible solution is to add a script to the test configuration and let it modify the copied *.dll.config file. I haven't time to check it yet. Dec 26, 2014 at 17:53

2 Answers 2


It's not the most elegant solution, but you can use different test settings for each configuration. We have a number of different test servers that our tests run against, and for each server we have a test setting. In the test setting you can go to "Advanced" and "Deployment" and add your config file.

We're actually just using the file name to determine an environment (ie if 'server3.txt' exists, the tests run against server3), but I don't see a reason that you couldn't use your tests.dll.config file here. The file is deployed to the directory your tests run from on the agent, so I would expect it to overwrite any app.config file that's there.

  • Hmmm... it sounds good. I'll take a try in the next a few days. Thanks for the suggestion! Dec 17, 2014 at 17:49
  • Feel free to mark this as an answer if it worked for you. Dec 18, 2014 at 15:36
  • I put together a configuration as you said but the original *.dll.config isn't overwritten by the attached *.dll.config. I went through the manuals and it doesn't say explicitly when these files are copied. I have to investigate it more. Dec 18, 2014 at 20:42
  • Hmm, I have a feeling it's copying the files you set up in the test settings before it copies the config file from your build. Is it possible to not include your web.config in what gets sent to the test agents? Dec 22, 2014 at 14:49
  • Unfortunately, It doesn't. I set up other files, different from everything I have in the stuff to be deployed and I haven't found anything on the test agent machine. :( Dec 22, 2014 at 15:46

The solution to your problem could be adopting something like "Octopus deploy" (https://octopus.com/), it is quite simple systems that you can automatically launch when a successful build completes. Octopus will deploy the latest build in two or more environments configuring every build based on your needs (for example editing properly the web.config).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.