2

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.

7
  • 1
    You should update your previous question rather than asking a new question.
    – c32hedge
    Apr 2, 2019 at 18:57
  • Possible duplicate of How to find out what is incorrect with vstestconsole
    – c32hedge
    Apr 2, 2019 at 18:58
  • same but different...didn't want to clutter them up.
    – Greg P
    Apr 2, 2019 at 18:58
  • 1
    The problem is this question seems to rely heavily on the previous one (at least in the wording) so it's hard for this question to stand on its own. If it's the same underlying problem, adding this as additional detail to your original question would likely get you better answers. (Also, consider adding additional formatting and organization to your question; both of them read as a rather large wall of text that is difficult to parse.)
    – c32hedge
    Apr 2, 2019 at 19:02
  • On the surface it sounds like you might be running the wrong thing. (trying to run tests in the APP rather than in a testing project). Would need a bit more information about how your solution is put together to give you better advice (are you using VS Code/ VIsual Studio 2017?)
    – Veretax
    Apr 2, 2019 at 19:44

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.