VS 2010 Test Runner error “The agent process was stopped while the test was running.”

前端 未结 19 1532
醉话见心
醉话见心 2020-12-22 21:13

In Visual Studio 2010, I have a number of unit tests. When I run multiple tests at one time using test lists, I sometimes reveive the following error for one or more of the

19条回答
  •  一生所求
    2020-12-22 21:15

    I added try/catch blocks to the descructor ~ClassName(){} that were defined in any class involved in my tests. This fixed the problem for me.

    ~MyClass()
    {
        try
        {
            // Some Code
        }
        catch (Exception e)
        {
            // Log the exception so it's not totally hidden
            // Console.WriteLine(e.ToString());
        }
    }
    

提交回复
热议问题