Wednesday, July 9, 2008

How to copy hibernate.config to the VSTS Output Folder?

VSTS is now included by default in the standard/professional version of 2008. Until now i was using NUnit +, etc.

I've decided to test VSTS and found 1 big problem : my nhibernate.config file was not copied to the output directory of the test output folder. I was expecting this to be automatically since I've set the "Always Copy" in the build property for the file.

Doing some basic Google searches I've noticed I am not the only guy having this problem.

The solution is to open the "localtestrun.testrunconfig" file which is added automatically to the solution by VSTS, go to "Deployment" and then add the file you want to deploy/copy.

Once this is done, the hibernate.config file copied every time we run a test. This can be seen in the image below. VSTS creates 1 output folder for each test run.