Test Explorer> Run All: System.Exception: Could not find the main application assembly

When I run the selected test, the test run runs correctly in Test Explorer. However, when using the Run All button, VS2012 throws a System.Exception that indicates

Could not find the main assembly of the application ...

Is there a place where I can set up a test explorer to find the build of the application?

As an example, we will be grateful.

+4
source share
1 answer

This proposal is to share and win in the search for problems.

Place the [IgnoreAttribute] attribute on top of all but one of your tests. Run it all. Is the same thing happening? If you do not delete, ignore another test and run everything again. Continue to do this until the failure. Is a particular test in combination unsuccessful with another? If so, what does this tell you ...

If the failure occurs immediately or independently of the selected tests, check the initialization methods that have [ClassInitialize ()] or [TestInitialize ()] above them (if any) and make sure that they do not cause problems, such as intiailzation happens more than once when you need to do this only once, setting a breakpoint in their methods and seeing if they are called as expected.

0
source

Source: https://habr.com/ru/post/1437678/


All Articles