C # Test running configuration (*. Runsettings)

By default, Visual studio will run tests in 1 thread. I want to run it in parallel. I have a test.runsettings file with the code below:

<?xml version="1.0" encoding="utf-8"?> <RunSettings> <RunConfiguration> <MaxCpuCount>4</MaxCpuCount> </RunConfiguration> </RunSettings> 

When I rebuild the solution or run the tests, I get the error below in the OUTPUT window:

 Invalid settings 'RunConfiguration'. Unexpected XmlElement: 'MaxCpuCount'. 

I copied the code for test.runsettings from the MSDN doc and selected this file from the VS test menu.

I am using Visual Studio 2015.

The problem is resolved. He will be working on updating VS 2015 1 and +.

Thank you for your help.

+7
c # testing visual-studio-2015 mstest
source share
2 answers

Creating a Test project in VS 2015 or later according to MSDN and creating a test.runsettings file

adding your content to this file:

 <?xml version="1.0" encoding="utf-8"?> <RunSettings> <RunConfiguration> <MaxCpuCount>4</MaxCpuCount> </RunConfiguration> </RunSettings> 

And adding it to the test settings works great for me. Take a look at the MSDN documentation. Perhaps you did something wrong.

EDIT:

Can you have updates for your sun? if not, maybe something is wrong with the solution or with your VS.

Reinstall VS as the last option.

+2
source share

Unloading and reloading the test project worked for me.

0
source share

All Articles