No! My Run config got toasted!

Another problem with the run configuration is that the template runconfig (The one that gets added to new solutions) can easily become overwritten with your user one, thus potentially screwing up test execution for all projects AND new projects. This only happens in a specific situation, but sadly this is a very common situation.

 

So, what happens? Well, when you create a new Test Project (not Empty Test project) you are prompted in the wizard to add a default run config to the solution. If you select this option the run config is added to the solution, and you’re good to go. The only problem here is the bug that adds the run config as a link rather than copying to the solution directory. Because of this, all changes to the run config made in this situation will result in those changes being reflected across ALL solutions that were created in the same way, and ALL new projects where you add a run config in any manner to the solution.

 

You can work around this simply by not using the wizard to add a run config to the solution, and instead letting the Run Config Dialog add the run config when you first run a test.

 

When you first go to execute tests when there is no run config associated with the solution, the dialog will not list anything in the “Run Configuration” Drop down – this is fine. Click the browse button, and select localtestrun.rcg. Click Open, then click OK. When prompted “Do you want to add this to the solution” select Yes, and all will go fine and dandy. If the file is not listed, navigate to %ProgramFiles%\Microsoft Visual Studio 8\Enterprise Developer Tools\Testing Tools\TestProjectCommon\Templates\RunConfig\1033 and the file should be located there.

 

If you manage to corrupt your localtestrun.rcg that resides in the project directory, you can just copy it off the install media again and you’ll be up and running again. This can be found in the %ProgramFiles%\Microsoft Visual Studio 8\Enterprise Developer Tools\Testing Tools\TestProjectCommon\Templates\RunConfig\1033 directory on the media – just copy this to the same path on the hard disk.