Visual Studio: Testing and deployment of files

1 comment

When doing unit testing in VS (2008) the default is as follows:

VS copies the compiled and all referenced assemblies to a folder named Testresults in a subfolder called something like:

username_pcname currentdatetime

If you have extra files, like for instance wse3policy.config, you need to tell vs to copy these files to the test folder, or else your tests will fail.

One way of doing it is by adding an attribute [DeploymentItem(path)] to your tests.

This will copy the files to the out folder.

You can also use menu Test -  Edit Test Run configuration and from within there select Deployment and select all the files you need for your tests to run.

But today I found a third option:

Turn off  Deployment.

In the same menu you selected files, you can uncheck the Deployment checkbox, and by doing this disable the entire copy assemblies and related files to a folder I really don't want issue… :)

This saves you the trouble of selecting which files you need for your tests,

it also makes your tests run a bit faster, as you don't have to wait for vs to create folders and copy all files to it for each run.

Be aware that this disables code coverage results, untill you either enable deployment again, or if you go into code coverage you will be told that to do this you need it enabled, and given the option to turn it back on.

Also note that you need to do this pr solution, as MS in their wisdom has made deployment the default, with no way to select a new default afaik.

If you have a lot of tests in your solution there is another option that can help speed things up.

Test Tools menu within Tools - Options, select Test Project and Disable background discovery of test.

This can help things speed along.

rgds

Henri

Posted via email from Henris blogg

1 comment :

  1. Harrah's Reno Casino & Hotel - jtmhub.com
    Harrah's Reno Casino & Hotel. 남원 출장샵 745 전라북도 출장안마 Sturgeon Lake Rd. 평택 출장안마 Reno, 계룡 출장마사지 NV 89109. Phone (877) 321-5343. Website. Website. 김제 출장안마

    ReplyDelete