locked
Event 1425. VSPERF. Unable to connect to monitor. Make sure the monitor is started and in the correct mode. RRS feed

  • Question

  • I am trying to execute unit test cases within VS2012 Ultimate. Following are the environment details :

    VS2012 Ultimate RTM Version 11.0.50727.1

    Windows 7 SP1 64 Bit

    .NET 4.5.50709

    Any unit test, which in VS2010 took a couple of seconds to execute, is now taking almost a minute to complete. On debugging, I figured that 90% of total test time was consumed before any test method code was executed. To come to this conclusion, I placed a break point on the 1st line of a test method and observed the time taken to hit that breakpoint.

    I see the following error in application event logs :

    Log Name:      Application
    Source:        VSPERF
    Date:          11/16/2012 2:10:27 PM
    Event ID:      1425
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Description:
    Unable to connect to monitor.  Make sure the monitor is started and in the correct mode.

    Is this the reason behind this delay ? If yes, what do i have to configure correctly to get back VS2010 execution speed ?

    Friday, November 16, 2012 7:16 PM

Answers

  • Unit test case which I used for this comparison:

    [TestMethod]

    [TestCategory("Mobile")]

    public void MobileGetShoppingCartTest()

    {

               MobileGetShoppingCartSummaryInput input = null;

               MobileGetShoppingCartSummaryOutput output = null;

               input = new MobileGetShoppingCartSummaryInput()

                          {

                                     MasterCustomerId = ""

                          };

     

    output = SvcClient.Post<MobileGetShoppingCartSummaryOutput>("MobileGetShoppingCartSummary", input);

     

               Assert.IsTrue(output.ShoppingCartItems.Count > 0, "Incorrect Result");

    }

    All I am trying to do out here is to make a POST call to a locally hosted oData service. In response, it returns a collection. All test parameters and conditions are same for VS2010 and VS2012. Let’s say that I place a breakpoint on line 1 of the above test case and then execute a single test in debug mode. Here are my observations in detail:

    • If I only have VS2010 installed on my development box, it hits bp in a matter of a second.
    • If I install VS2012 and execute the same test in VS2010 or VS2012, the bp is hit after 20 – 30 seconds.

    I also get the following FileNotFoundException in application event log when executing the test in VS2012:

    <EventData>

        <Data>(devenv.exe, PID 7204, Thread 1) System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodeCoverage, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

    File name: 'Microsoft.VisualStudio.QualityTools.CodeCoverage, PublicKeyToken=b03f5f7f11d50a3a'

       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)

       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)

       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)

       at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

       at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage.InitializeTestProjectPlugins()

    WRN: Assembly binding logging is turned OFF.

    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

    Note: There is some performance penalty associated with assembly bind failure logging.

    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    </Data>

      </EventData>

    Not sure what plugin is that or why was it failing to find the dll. Version 11 is present in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies folder. None the less I resolved this issue by making 2 changes:

    1. Commented local.testsettings to disable code coverage:

    <AgentRule name="LocalMachineDefaultRole">

          <DataCollectors>

            <DataCollector uri="datacollector://microsoft/CodeCoverage/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn, Microsoft.VisualStudio.QualityTools.Plugins.CodeCoverage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Code Coverage">

              <Configuration>

                <CodeCoverage xmlns="">

                  <Regular>

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Business.Base.dll" pdbFile="CommonBin\Personify.DataServices.Business.Base.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="C:\Projects\Personify.DataServices\Current\Personify.WebService.Designer\CommonBin\Personify.DataServices.Common.dll" pdbFile="C:\Projects\Personify.DataServices\Current\Personify.WebService.Designer\CommonBin\Personify.DataServices.Common.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Core.dll" pdbFile="CommonBin\Personify.DataServices.Core.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.EF.Provider.dll" pdbFile="CommonBin\Personify.DataServices.EF.Provider.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Serialization.dll" pdbFile="CommonBin\Personify.DataServices.Serialization.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.Persistence.dll" pdbFile="CommonBin\Personify.Persistence.pdb" instrumentInPlace="true" />

                  </Regular>

                  <AspNet>

                    <AspNetCodeCoverageItem id="1c0c257a-7867-45d2-8d2f-6999df8a8083" name="PersonifyDataServicesBase" applicationRoot="/PersonifyDataServicesBase" url="http://localhost/PersonifyDataServicesBase/" isIis="true" />

                  </AspNet>

                </CodeCoverage>

              </Configuration>

            </DataCollector>

          </DataCollectors>

        </AgentRule>

    2. Installed Resharper plugin for VS2012 to execute unit tests.

    • Marked as answer by dhruba Friday, November 23, 2012 1:48 AM
    Friday, November 23, 2012 1:47 AM

All replies

  • Hello Dhruba,

    Thank you for posting in the MSDN forum.

    There are many differences between VS2010 and VS2012 originally. VS2012 has some API that VS2010 does not have and some API in VS2010 still can be used in VS2012. As for the run speed, many factors can cause to run the same test in VS2012 slower for example the test environment and resource usage.

    I would like to know what your scenario is in your solution. Whether there are many tests in your project or not? After some seconds of loading, can you debug/step into your test successfully?

    When many projects and test projects with many tests are in one solution, it is possible to spend long time loading before debugging.

    As for the error, I don’t understand the monitor. We can't comfirm that the run speed is related to that error. What monitor do you connect to? Maybe you can clarify it so that we can further look at this issue.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us



    • Proposed as answer by Amanda Zhu Thursday, November 22, 2012 8:07 AM
    • Unproposed as answer by Amanda Zhu Friday, November 23, 2012 12:39 AM
    • Marked as answer by Amanda Zhu Friday, November 23, 2012 12:57 AM
    • Edited by Amanda Zhu Friday, November 23, 2012 12:58 AM
    • Unmarked as answer by dhruba Friday, November 23, 2012 1:45 AM
    Monday, November 19, 2012 4:03 AM
  • See if this helps http://donovanbrown.com/post/I-cant-get-Code-Coverage-to-work-on-IIS7.aspx

    Thanks,

    Anuj


    The opinions expressed here are completely my own. I also blog on http://www.anujchaudhary.com/

    Tuesday, November 20, 2012 3:34 AM
  • Hello Dhruba,

    What about your issue now? Could you get useful information from our reply?

    Would you mind letting us know the result of the suggestion?

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 20, 2012 9:23 AM
  • Unit test case which I used for this comparison:

    [TestMethod]

    [TestCategory("Mobile")]

    public void MobileGetShoppingCartTest()

    {

               MobileGetShoppingCartSummaryInput input = null;

               MobileGetShoppingCartSummaryOutput output = null;

               input = new MobileGetShoppingCartSummaryInput()

                          {

                                     MasterCustomerId = ""

                          };

     

    output = SvcClient.Post<MobileGetShoppingCartSummaryOutput>("MobileGetShoppingCartSummary", input);

     

               Assert.IsTrue(output.ShoppingCartItems.Count > 0, "Incorrect Result");

    }

    All I am trying to do out here is to make a POST call to a locally hosted oData service. In response, it returns a collection. All test parameters and conditions are same for VS2010 and VS2012. Let’s say that I place a breakpoint on line 1 of the above test case and then execute a single test in debug mode. Here are my observations in detail:

    • If I only have VS2010 installed on my development box, it hits bp in a matter of a second.
    • If I install VS2012 and execute the same test in VS2010 or VS2012, the bp is hit after 20 – 30 seconds.

    I also get the following FileNotFoundException in application event log when executing the test in VS2012:

    <EventData>

        <Data>(devenv.exe, PID 7204, Thread 1) System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodeCoverage, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

    File name: 'Microsoft.VisualStudio.QualityTools.CodeCoverage, PublicKeyToken=b03f5f7f11d50a3a'

       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)

       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)

       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)

       at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

       at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage.InitializeTestProjectPlugins()

    WRN: Assembly binding logging is turned OFF.

    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

    Note: There is some performance penalty associated with assembly bind failure logging.

    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    </Data>

      </EventData>

    Not sure what plugin is that or why was it failing to find the dll. Version 11 is present in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies folder. None the less I resolved this issue by making 2 changes:

    1. Commented local.testsettings to disable code coverage:

    <AgentRule name="LocalMachineDefaultRole">

          <DataCollectors>

            <DataCollector uri="datacollector://microsoft/CodeCoverage/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn, Microsoft.VisualStudio.QualityTools.Plugins.CodeCoverage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Code Coverage">

              <Configuration>

                <CodeCoverage xmlns="">

                  <Regular>

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Business.Base.dll" pdbFile="CommonBin\Personify.DataServices.Business.Base.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="C:\Projects\Personify.DataServices\Current\Personify.WebService.Designer\CommonBin\Personify.DataServices.Common.dll" pdbFile="C:\Projects\Personify.DataServices\Current\Personify.WebService.Designer\CommonBin\Personify.DataServices.Common.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Core.dll" pdbFile="CommonBin\Personify.DataServices.Core.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.EF.Provider.dll" pdbFile="CommonBin\Personify.DataServices.EF.Provider.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.DataServices.Serialization.dll" pdbFile="CommonBin\Personify.DataServices.Serialization.pdb" instrumentInPlace="true" />

                    <CodeCoverageItem binaryFile="CommonBin\Personify.Persistence.dll" pdbFile="CommonBin\Personify.Persistence.pdb" instrumentInPlace="true" />

                  </Regular>

                  <AspNet>

                    <AspNetCodeCoverageItem id="1c0c257a-7867-45d2-8d2f-6999df8a8083" name="PersonifyDataServicesBase" applicationRoot="/PersonifyDataServicesBase" url="http://localhost/PersonifyDataServicesBase/" isIis="true" />

                  </AspNet>

                </CodeCoverage>

              </Configuration>

            </DataCollector>

          </DataCollectors>

        </AgentRule>

    2. Installed Resharper plugin for VS2012 to execute unit tests.

    • Marked as answer by dhruba Friday, November 23, 2012 1:48 AM
    Friday, November 23, 2012 1:47 AM
  • Hello Dhruba,

    Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 23, 2012 2:49 AM