One of the common complaints I hear about Unit Testing in Visual Studio centers around test deployment. By default, when you run a unit test, the assemblies get copied to another location to be run. The assemblies and test results are copied to the following folders:
<Users Documents>\Visual Studio 2008\Projects\<Project Name>\Test Results
There are then subfolders based on the username, computer name, date and time, and further sub-folders representing the inputs and outputs of the test(s).
For most scenarios, this behavior is transparent and doesn't cause problems. If your assembly has dependencies however, unit tests can fail as the dependencies are not deployed automatically. You can attach deployment dependencies by double-clicking the LocalTestRun.testrunconfig file in the solution root, going to the Deployment tab, and adding any necessary files or directories that should be deployed with the assembly.
But this is a bunch of extra work, and can be viewed as 'friction' by some. Fortunately, there is another option. Many of the folks who complain about the deployment feature of Unit Tests point to NUnit as having an option to turn deployment on or off.
As it turns out, Unit Tests have the same option, and it was right under my nose the whole time. In the same Deployment tab, there is a checkbox at the top titled "Enable Deployment". By un-checking this options, you can tell the test framework not to deploy assemblies to another location before running the unit tests.
If you would like to make non-deployment the default option, you can modify the LocalTestRun.testrunconfig file in the "C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Testing Tools\TestProjectCommon\Templates\RunConfig\1033" directory by changing the Deployment node to:
<Deployment
enabled="false" />
There is one caveat however; code coverage, remote execution, and device test projects all require deployment, so turning it off will disable this functionality.