Visual Studio 2022 throws error with file extension specified '.dll' is not a valid test extension when we run from command line using MSTest.exe

PONNALA Divya 21 Reputation points
2022-01-25T15:04:14+00:00

I have installed latest Visual studio 2022 and added CodedUI component while installing and then I tried to run my codedUI tests from command line with MStest.exe but I was facing the error 'File extension specified '.dll' is not a valid test extension. I was able to run the same tests using Visual studio 2017 command line .Can some one let me know why VS 2022 is not able to identify the extension. PFA for additional reference.

![168392-image.png][1]

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
351 questions
{count} votes

Accepted answer
  1. Michael Taylor 54,901 Reputation points
    2022-01-25T16:05:53.8+00:00

    The warning that is printing is trying to lead you down the right path. mstest is obsolete. You need to switch to the vstest runner instead. Adjust your command line to use the newer tool. I suspect your problem will go away.

    As for mstest it can generate this error in a variety of cases so there is potentially a pathing problem. If it doesn't find all the binaries it expects it can generate the error. This includes the test adapter and test framework assemblies. Given that you're running Jenkins I'd probably start by verifying the test path it is trying to run against. Another cause is misconfigured or missing toolset so I'd make sure you installed CodedUI as well. CodedUI is deprecated so it is possible that something is missing from the VS2022 release that Jenkins needs.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.