Visual Studio 2013 doesn't discover unit tests

前端 未结 30 2121
余生分开走
余生分开走 2020-11-28 21:46

I have a simple solution in visual studio 2013 that is composed by one web project, one library project and one unit test project. When I open the solution and try to run th

30条回答
  •  攒了一身酷
    2020-11-28 22:23

    Sorry for adding to the long list, but I had a completely a different problem. First, I would like to mention I discovered my issue when clicking 'Run All' in the Test Explorer and then watching the build output window in Visual Studio. You have to actively watch it, as afterwards the message disappears.

    As for the issue, it looks like during the scanning of the tests, the DLL gets loaded and its test types are enumerated. This causes the references to be loaded and if any failure occurs during this process, the tests will not be shown in the explorer. I had two issues preventing the test DLL to be successfully loaded:

    • There was still a binding redirect left in the config file (redirecting to a version lower version NHiberate than what was referenced in the test project).
    • A conflicting assembly reference (2nd level references not being able to load). AsmSpy is btw a great tool to hunt for these.

提交回复
热议问题