locked
MSTest "Specified cast is not valid" RRS feed

  • Question

  • Hello,
    I am trying to run our tests with the command prompt via MSTest.exe. The tests run fine from within VS, but I get this error from the command prompt.

    MSTest /testmetadata:C:\myProject\project.vsmdi
    ...
    Starting execution...
    Specified cast is not valid.

    We have 800 total tests, 300 ignored, 5 projects. Each individual project runs fine from the command line using "/testcontainer".

    Some notes:
    1 - I am running VS Team Edition for Software Dev.
    2 - I am using the *.vsdmi file created from VS. It works fine on smaller tutorial projects.
    3 - I saw this post to make sure that each project has at least 1 test:
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=162564&SiteID=1

    I still get the "Specified cast is not valid" error. Does anyone know what else could be causing it?

    Thanks,
    Tim

    Monday, January 30, 2006 11:06 PM

Answers

  • Tim
    Have you tried adding a /test or /testlist to your command line. The MSDN docs for MSTest.exe command line recommend that that when you use the /testmetadata option that you indicate specific tests to run by using the /test option or the /testlist option, or both.

    Thanks
    Brian [MSFT]
    Microsoft Developer Support
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, February 1, 2006 11:07 PM

All replies

  • Tim
    Have you tried adding a /test or /testlist to your command line. The MSDN docs for MSTest.exe command line recommend that that when you use the /testmetadata option that you indicate specific tests to run by using the /test option or the /testlist option, or both.

    Thanks
    Brian [MSFT]
    Microsoft Developer Support
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, February 1, 2006 11:07 PM
  • Thanks for the email. I'm making the tests with "Team Edition for Software Dev", so I don't have the Test Manager window to create the testLists. I'll just make a separate /testcontainer for each of my 5 projects. That works.

    Thanks,
    Tim

    Thursday, February 2, 2006 11:29 PM
  • How do you create a testlist from the developer version to VS 2005? I'm trying to get accurate code coverage numbers but in order to do that it seems I need to have one pass through the system instead of one per test project.

     

    Thank you

     

    Monday, November 12, 2007 5:27 PM