Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting "Index was outside the bounds of the array" when running mstest.exe on the commandline?

I am running this on my machine

"%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:"C:\Working\Einstein\Solutions\EinsteinAcceptanceTests\bin\Debug\EinsteinAcceptanceTests.dll" /resultsfile:TestResult.trx"

And I get

index was outside the bounds of the array

message back.

Any clue on how to debug this?

like image 498
codeAline Avatar asked Sep 02 '11 14:09

codeAline


2 Answers

You may check for version incompatibility. E.g. you get this error when trying to run VS2008 Tests with VS2010 mstest.exe.

like image 72
Andreas Avatar answered Oct 11 '22 18:10

Andreas


It happened to me in VS 2012, the problem being that I had 2 unit test projects referencing to different versions of the assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework'

I saw the problem when compiling the solution, in the output window from the test section:

------ Discover test started ------
index was outside the bounds of the array

like image 30
Cristian T Avatar answered Oct 11 '22 17:10

Cristian T