How to: Import a Solution and Its Tests

You can import a solution from disk into a solution that you have open. When you do this, your new solution contains the merged contents of both solutions. For more information, see the section "Importing a Solution and Its Tests," in this topic.


Within a solution, every project must have a unique name. If a project in the solution that you are importing has the same name as a project in your original solution, the project in the new solution is not imported.

If a solution contains a test project, it also contains a test metadata file. This metadata file resides, together with the run configuration file, in a Solution Items folder. If the solution you are importing also contains a Solution Items folder, Visual Studio renames it by appending a number, for example, Solution Items (2).

While test metadata files are imported, you are prompted to merge, keep, or replace the original metadata.

Run configuration files in the imported solution are automatically moved into the original Solution Items folder, and if necessary, renamed to avoid name conflicts. If, after the import process has completed, the Solution Items (2) folder is empty, it is removed.

Importing a Solution and Its Tests

In this procedure, you first open your "original" solution in Visual Studio and then you open a second solution without closing the first solution.

To import a solution and its tests

  1. Open a solution in Visual Studio.

  2. On the File menu, point to Open, and then click Project/Solution.

    The Open Project dialog box is displayed.

  3. Click Add to Solution.

  4. Go to the folder that contains the solution file for the solution you want to open. Solution files have the extension .sln. Select this file and then click Open.


    If the second solution contains a project whose name matches that of a project in your first solution, the project in the second solution is not imported, and a dialog box alerts you. Projects without name conflicts are imported silently.

    The contents of the new solution have been merged into your original solution. Your solution may now contain multiple Solution Items folders.

See Also


How to: Configure the Dialog Boxes of Test Edition


Reusing Tests

Dialog Boxes of Test Edition

Other Resources

Managing Large Numbers of Tests