Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Test Settings template in VS2010 Ultimate

I'm attempting to add a Test Settings file to my Unit Tests project in VS2010. All websites seem to simply say "Go to Add New Item > Installed Templates > Test Settings". However, I don't have Test Settings as an option in my Installed Templates (nor does searching for them online turn up any results).

Can someone point me in the right direction for what I need to do?

like image 585
JustLoren Avatar asked May 28 '10 19:05

JustLoren


2 Answers

Unless they changed this dramatically since VS2k8, you'll see that when you create a new test project, you'll get a new "solution folder" in your solution called "Solution Items" with a .testRunConfiguration file in it which contains the settings.

If not, then you can create the "solution folder" yourself. Right-mouse click on your solution and select Add -> New Solution Folder. Right-mouse click on the folder and select Add -> New Item. Select "Test Run Configuration" under "Categories". If you click on the project, you will not see these choices.

If that doesn't still work in VS2k10, I'll be interested in knowing.

Response to JustLoren's Comment I did a quick Google search and found this: http://social.msdn.microsoft.com/Forums/en/vststest/thread/8ef10a3a-d4d5-4931-9054-df1d81ee4842..

Apparently, they did change the file extension from .testrunconfig to .testsettings in VS2k10. I believe that the key to solving your problem is likely to properly create the Solution Items solution folder and add your configuration file there.

like image 161
Vivian River Avatar answered Oct 22 '22 14:10

Vivian River


For Visual Studio 2015 Enterprise, I had a really hard time figuring out how to create this file. I don't see the option in the Menu and creating a "Solution" or "Solution Items" folder did not get me any closer to the solution.

What I did was create a XML file and named it "Default.testsettings". VS will then complain:

The Test Settings file XXXX does not have the expected format: Root element is missing.

Then right click the new file and Select "Open With...", Then in the resulting window select "Source Code (Text) Editor" then hit OK.

enter image description here

An empty XML file should open, paste the following code into the file:

<?xml version="1.0" encoding="utf-8" ?> 
<TestSettings name="TestSettings1" 
    id="c75a9e88-b995-43e0-964b-ff82703d6650" 
    xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
</TestSettings>

Then save and exit the file, double click the "Default.testsettings" to open it in the default "Test Settings Editor". You should now be able to edit the file normally.

like image 2
David Rogers Avatar answered Oct 22 '22 14:10

David Rogers