title: orderedtests not working with vstest.console.exe when .runsettings file is specified - MS Test
body: <p>I have the following:</p>
  
  <ol>
  <li>.orderedtest file which has a list of tests in an order</li>
  <li>.runsettings file where I have specified some test parameters</li>
  </ol>
  
  <p>I am trying to execute the tests through command line, using the following command:</p>
  
  <p><strong>vstest.console.exe MyOrderedTests.orderedtest /Settings:MyTestParameters.runsettings /TestCaseFilter:"TestCategory=Production" /Logger:trx</strong></p>
  
  <p>I am getting the below warning and none of the tests are executed.</p>
  
  <p><strong>Warning: No test is available in MyOrderedTests.orderedtest. Make sure that installed test discoverers &amp; executors, platform &amp; framework version settings are appropriate and try again.</strong></p>
  
  <p>I really appreciate the help!</p>
  
  <p>I even tried to run tests through the VS IDE. To elaborate more:
  1. I have two tests
  2. I have a Class Initialize which access the TestRunParameters from a .runsettings file.
  3. I print the TestRunParameter in the tests.
  4. I execute the tests individually and even all at once, they execute just fine.</p>
  
  <p>Now I introduce the test ordering using .orderedtest file
  1. I execute the tests using this orderedtest file and I get the NullReferenceException in the Class Initialize (where it tries to access the TestRunParameters from .runsettings file)</p>
  
  <p><strong>Class Initialization method TestTestProject.UnitTest1.ClassInit threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..</strong></p>
  
  <p>Below is my simple sample test code:</p>
  
  <p>public static string url;</p>
  
  <pre><code>    [TestMethod]
      public void TestMethod1()
      {
          Console.WriteLine("Test Method 1");
          Console.WriteLine(url);
      }
  
      [TestMethod]
      public void TestMethod2()
      {
          Console.WriteLine("Test Method 2");
          Console.WriteLine(url);
      }
  
      [ClassInitialize]
      public static void ClassInit(TestContext context)
      {
          url = context.Properties["webAppUrl"].ToString();
      }
  </code></pre>
  
  <p>I get the NullReferenceException in the ClassInit().</p>