Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 "MSTest /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!

like image 933
Riddler Avatar asked Dec 21 '10 16:12

Riddler


3 Answers

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)

like image 106
CRice Avatar answered Sep 30 '22 23:09

CRice


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)

like image 27
Nikita R. Avatar answered Oct 01 '22 00:10

Nikita R.


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

enter image description here

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.

like image 29
N-ate Avatar answered Oct 01 '22 01:10

N-ate