Test run errors with MSTest in VS2010

前端 未结 2 2134
终归单人心
终归单人心 2020-12-15 10:41

When I run my Unit Tests, all tests pass, but instead of \"Test run succeeded\" or whatever the success message is, I get \"Test run error\" in the little bar that tells me

相关标签:
2条回答
  • 2020-12-15 10:51

    First of all - you have Code Coverage enabled. You can read here about it. So there is no problems with Unit Tests. This is code coverage problem.

    Second thing - this warning is ok - never mind about it.

    Third thing - this error - this is the key problem.

    There can be different problems - most common is that you should refference more assemblies. To find out what exactly should be loaded you must go to Event Viewer and look at at Windows Logs->Application

    0 讨论(0)
  • 2020-12-15 10:51

    I had the same error related to MS-Test complaining that a DLL could "override deployment item blah.dll".

    This was happening because I was running MS-Test for multiple DLL's at once like so:

    mstest.exe /testcontainer:Tests.web.dll /testcontainer:Tests.svcs.dll /testcontainer:Tests.core.dll
    

    When MS-Test was running this, it tried to take all the output DLL's from the tests and place them in out /Out directory of the test run. In my case, Tests.svcs.dll and Tests.core.dll both referenced the same assembly (Core.dll) and therefore it tried to copy that DLL to the same spot twice (thus causing the warning).

    To resolve this, I separated the test runs for each assembly which gave each test run it's own /Out folder for output DLL's

    mstest.exe /testcontainer:Tests.web.dll
    
    mstest.exe /testcontainer:Tests.svcs.dll
    
    mstest.exe /testcontainer:Tests.core.dll
    
    0 讨论(0)
提交回复
热议问题