What is needed at a minimum to have vstest.console to run using .net 4.6.1 on VS 2017



  • Sorry if I have asked similar questions. But I went back to basics. I created a simple application in Windows 2017. Unit Test Project (.Net Framework) in .NET 4.6.1. Just one test to see if "test="test". Runs successfully running through debug test through visual studio. From creating the project it only includes MSTest.TestAdapter and MSTest.TestFramework, both v1.4. So, as you can see, totally minimilistic. But whenever I try to run through vstest.console, get the error of "Warning: No test is available in xxxxxxx. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again." So, my question is, what is needed to run through vstest? At a minimum? Is there a specific dll?

    More detail - Created new project - A "Unit Test Project (.Net Framework) Visual c#.

    Took the default unittest.cs file and posted this...just to execute anything: using System; using System.Diagnostics.Eventing; using Microsoft.VisualStudio.TestTools.UnitTesting;

    namespace testtesttest { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { Assert.AreEqual(1, 1, 0.001, "Account not debited correctly"); } } }

    Took the default packages.config with no changes. Saved it..ran through Visual Studio Menu option Test -> Run all tests...which it passes

    Went into powershell and into the location of my dll.. C:\development\stash\testtesttest\bin\debug>

    And ran the following command: vstest.console.exe testtesttest.dll, and this is when I get the error of not being able to find any of the tests.



  • Well, I found this link, that helped...I didn't know that my visual studio project that has mstest installed as a package included with it, did not know where the testadapter was located.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/f44db2d5-61ae-428b-8412-5a3fc739daf7/vstestconsoleexe-not-discovering-any-of-the-tests?forum=vstest

    had to add /TastAdapterPath:c:\myproject\packages\mstest.testadapter.1.4.0\build_common to my command line.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2