Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Test running configuration(*.runsettings)

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

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

When I rebuild solution or run the tests I'm getting the error below in OUTPUT window:

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

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

I'm using Visual studio 2015.

Problem is solved. It will work on VS 2015 update 1 and +.

Thanks for your help.

like image 560
Jamaxack Avatar asked Jul 26 '16 09:07

Jamaxack


1 Answers

Creating a Test project in VS 2015 or newer 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 testsettings, works fine for me. Have a look at the MSDN-Documentation. You might have done something wrong.

EDIT:

You may have updates for your VS? if not, maybe something wrong with the solution or with your VS.

As last option, reinstall VS.

like image 128
M. Schena Avatar answered Sep 23 '22 06:09

M. Schena