2014-02-25 130 views
1

我建造一個簡單的測試DLL(.NET 3.5,調試,86)MSTEST錯誤 - qtagent32.exe已停止工作

using Microsoft.VisualStudio.TestTools.UnitTesting;  
namespace TestProject1 
{ 
    [TestClass] 
    public class UnitTest1 
    { 
     [TestMethod] 
     public void TestMethod1() 
     { 
      Assert.AreEqual("111", "111"); 
     } 
    } 
} 

當我從CMD運行MSTEST工具:

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" /testcontainer:"TestProject1.dll" 

我得到這個錯誤: enter image description here

但測試工作,如果TestProject1將與淨4.0

被建造。 10

我有一個Windows 7旗艦版,VS 2010和2013沒有任何更新。 任何人都可以幫助我。謝謝!

回答

1

結帳的類似的問題在這裏:mstest.exe vs2012 crashes qtagent32.exe

注意,我沒有按照列出的任何解決方案,但我跟着a Microsoft article上市,而不是使用mstest.exe的vstest.console.exe的解決方法。

(也注意到,對於vstest.console.exe參數是不同的它想Test.dll的的的空間分隔的列表)。

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "TestProject1.dll" 

這裏是我的MSBuild設置,做同樣的事情:

<PropertyGroup> 
    <MSTEST>"$(VS110COMNTOOLS)..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"</MSTEST> 
</PropertyGroup> 
... 
<Target Name="MyTests" > 
    <ItemGroup> 
    <!-- These Items should be evaluated at Target runtime --> 
    <TestFiles Include="..\Tests\**\bin\$(Configuration)\*.Test.dll" /> 
    </ItemGroup> 
    <!-- Run Tests --> 
    <PropertyGroup> 
    <!--TestSuccessOrNot is the property specify whether the Test is sucess or not --> 
    <TestSuccessOrNot>1</TestSuccessOrNot> 
    </PropertyGroup> 
    <Exec Command="$(MSTEST) @(TestFiles, ' ')" > 
    <Output TaskParameter="ExitCode" PropertyName="TestSuccessOrNot"/> 
    </Exec> 
    <Error Text="Tests Failed" Condition="$(TestSuccessOrNot) == '1'" /> 
</Target>