Monday, March 5, 2012

Enabling logging on MSTest.exe

Many times you might need to enable verbose logging on MSTest.exe to debug the Test related issue on the build machine.

Here are the steps

Step 1: Find the MSTest.exe.config file on the build machine. It can be found at the following location
<Drive:>\Program Files\Microsoft Visual Studio 10.0\Common7\IDE

Step 2: Make a backup copy of MSTest.exe.config file

Step 3: Add the following <system.diagnostics> in the MSTest.exe.config file
<system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="EqtListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Temp\MSTestTrace.log" />
      </listeners>
    </trace>
    <switches>
      <add name="EqtTraceLevel" value="Verbose" />
    </switches>
  </system.diagnostics>

Step 4: Here is the sample updated file.

<?xml version ="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="PrivateAssemblies;PublicAssemblies;PrivateAssemblies\DataCollectors;PrivateAssemblies\DataCollectors\x86"/>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.QualityTools.UnitTestFramework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="10.1.0.0" newVersion="10.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
<system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="EqtListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Temp\MSTestTrace.log" />
      </listeners>
    </trace>
    <switches>
      <add name="EqtTraceLevel" value="Verbose" />
    </switches>
  </system.diagnostics>
  <appSettings>
    <add key="GetCollectorDataTimeout" value="300"/>
    <add key="TestProjectRetargetTo35Allowed" value="true" />
  </appSettings>
</configuration>

Step 5: Restart the “Visual Studio Team Foundation Build Service Host” service on build machine. The next build would log the detail.

3 comments:

  1. I'm gonna try this, and if helps, I think you've rescued my headache for a week.

    ReplyDelete
  2. This website can live streaming , you can join at my site :
    agen judi online terpercaya
    Prediksi Bola

    Thank you
    agenpialaeropa.org
    gamesonline.ga
    beritasemasaterikini.com

    ReplyDelete
  3. NAGAQQ | AGEN BANDARQ | BANDARQ ONLINE | ADUQ ONLINE | DOMINOQQ TERBAIK

    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Memegang Gelar atau title sebagai QQ Online Terbaik di masanya

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66
    * Sakong
    * Capsa Susun
    * AduQ
    * Perang Bacarrat (New Game)

    Tersedia Deposit Via pulsa :
    Telkomsel & XL

    Info Lebih lanjut Kunjungi :
    Website : NAGAQQ
    Facebook : NagaQQ Official
    Kontakk : Info NagaQQ
    linktree : Agen Judi Online
    WHATSAPP : +855977509035
    Line : Cs_nagaQQ
    TELEGRAM : +855967014811


    BACA JUGA BLOGSPORT KAMI YANG LAIN:
    agen bandarq terbaik
    Winner NagaQQ
    Daftar NagaQQ
    Agen Poker Online

    ReplyDelete