We recommend using Visual Studio 2017

How to: Add a Test Settings File from Microsoft Visual Studio

You can add test settings to be used with your tests.

Caution note Caution

Before adding a .testsettings file to your unit test project or your coded UI test project, it is important to understand the compatibility issues. In Visual Studio 2012, test settings are not included in your solution when a unit test project or a coded UI test project is added. This is a result of the enhancements in the Unit Test Framework to improve extensibility, resilience, and performance. However, if necessary, you can add a .testsettings file to your solution if you need to collect specific data from a data and diagnostic adapter or run your test with test controllers. Additionally, you can open an existing Visual Studio 2010 solution containing a .testsettings file and it will continue to run. This note does not apply to Web Performance Test projects as these test types still use test settings. For more information, see Compatibility of Test Settings with Visual Studio 2010.

To add a test setting to a web performance a load test project, unit test project, or coded UI test project

  1. In Solution Explorer, open the shortcut menu on the solution that you want to add a test setting to and select Add new item.

    Add a test setting

    The Add New Item dialog box displays.

  2. Choose Test Settings and then choose Add.

    Add a test setting

    The test setting is added to your solution.

    For information about filling in the details for your new test setting, see Create Test Settings to Run Automated Tests from Visual Studio.

    For information about making the test setting the active test setting in your solution, see How to: Select the Active Test Settings from Microsoft Visual Studio.

Show: