开发者

MSTest: "File extension specified '.dll' is not a valid test extension"

开发者 https://www.devze.com 2023-01-31 20:54 出处:网络
I have a test project in VS2010, and I need to run the unit tests from command line. On one machine the following scenario works just fine:

I have a test project in VS2010, and I need to run the unit tests from command line. On one machine the following scenario works just fine:

1) Build the tests via "MSBuild test_project.csproj"

2) Run the tests via "MSTe开发者_如何学Cst /testcontainer:test_project.dll"

But on the other machine the 2nd step produced a weird error message, namely: "File extension specified '.dll' is not a valid test extension"

Any idea how to tackle this?

Thanks!


Check the registry on a PC that has Visual Studio 2010 installed: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\TestTypes\.

This contains all entries in regards to allowed extensions for MSTest. It would also probably be best to search for the test type keys (e.g. {13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b}) and making sure they exist (.dll must be in the list of allowed extensions)


If your 'other machine' is the build machine and there's no Visual Studio installed, you need to install Test Agent and Test controller (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1334).

Take a look at the post Running tests in mstest without installing the VS IDE (http://blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx)


If you are missing any of the following files it may cause this exception:

MSTest: "File extension specified '.dll' is not a valid test extension"

The files can be in the same directory or any configured directory. Configured locations can be found in MSTest.exe.config as an attribute on the probing element.


I ran into this same problem with Visual Studio 2019, and it fact it was on a single computer. For one user account, things worked fine, but for another account, I got this error.

I realized that for the second user account, I had never launched Visual Studio.

To resolve the problem, all I had to do was to log in as that second user account and launch Visual Studio, and then MSTest worked successfully afterwards.


I've read here and it says "mstest is obsolete" now. Please use vstest - I was facing same issue on GitHub Actions while running the workflow on self hosted runner.

Using VSTest issue has been fixed.

Note: Please follow the command line syntax carefully to avoid unexpected issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消