Certain errors can be encountered for any test that can run automatically, which means any test type other than manual. These errors are frequently related to the deployment of tests. When a test is deployed, the file that contains it is copied to another folder, either to a location on the local computer or to a remote computer.
For unit tests, for example, the .dll file that was built from the test project is the file that must be deployed. If this binary file cannot be deployed, any unit tests that it contains are immediately marked as Failed in the Test Results window when you run them.
To fix this error, verify that the files are available on your local computer and that there were no build errors the last time that you rebuilt your test binaries.
Not only binary files can be deployed. You might specify that a particular file, such as a data file, is required by a test and must therefore be deployed with the test. At deployment time, if this file cannot be found because it has been moved or deleted, the test cannot run correctly and an error occurs. Also see Details by Test Type for information about this error with regard to generic tests.
To investigate this error, first note the files and folders specified on the Deployment page of the dialog box used to edit test settings. For more information, see Create Test Settings to Run Automated Tests from Visual Studio. Then check those files and folders on disk to make sure they are present and that their names are identical.
Your solution may have multiple test settings files. If this is the case, make sure that you examine the test settings that was active when the test error occurred. To determine which test settings was active, examine the Test Run Details page for that test run.
For more information about active test settings files, see How to: Apply Test Settings from Microsoft Visual Studio.