none
IVsHierarchy is not expected error when analyzing code coverage

    Question

  • I have having a persistent issue when attempting to analyze code coverage in Visual Studio 2013 Ultimate. When attempting to analyze I receive the following error:

    The input IVsHierarchy is not expected, please ensure to pass the correct IVsHierarchy object. A common mistake would be the stub proxy was passed when the method was invoked on a background thread.


    This only appears to be happening on my computer. Coworkers of mine can analyze code coverage on the same solution and same source code with no issues. I have already attempted to repair the Visual Studio 2013 installation with no luck. I have also removed Resharper to ensure that was not causing an issue.

    I have scoured the internet for a solution to this issue and so far have not found one. 

    Please help!

    Thank you,

    Patrick


    Monday, November 30, 2015 10:35 PM

Answers

  • I was able to determine the problem. My solution includes a NuBuild project, which is a Visual Studio add-in for creating nuget packages. On a hunch I unloaded this project from my solution and that allowed me to run code coverage analysis.
    Thursday, January 14, 2016 2:29 PM

All replies

  • Hi Patrick,

    Please create a new test to analyze code coverage with Visual Studio 2013 to make sure whether this problem occurs with all test or just this specific test.

    If just for this specific test, there may be something wrong with current test project. Please create a new test project and then move the project files to new project one by one.

    If for all projects, this problem may be caused by your Visual Studio 2013. Please try with following steps to troubleshoot this problem.

    1. Run Visual Studio 2013 as administrator.
    2. Run Visual Studio 2013 in safe mode with "Devenv.exe /SafeMode" command to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.
    3. Close all third part software, such as antivirus software.
    4. If this problem not occurred before, please try reset all settings through menu Tools -> Import and Export settings -> Reset all settings.

    Best Regards,
    Weiwei


    Wednesday, December 02, 2015 3:28 AM
    Moderator
  • Thank you for your suggestions. Unfortunately this did not correct the issue.
    Thursday, December 03, 2015 2:25 PM
  • Hi Patrick,

    Please compare the Visual Studio 2013 version information first from menu Help -> About Microsoft Visual Studio, it will list all installed products on with your Visual Studio as below image shows. Besides, please make sure you have installed the latest Update (Update 5) for Visual Studio 2013.

    Then please compare the operation steps about how do you set your Code Coverage settings with your colleague. Or you can copy the test from your colleague's computer to yours, which can help us make sure whether this problem is caused by computer environment.

    In addition, according to the error message, IVsHierarchy interface is used to provides hierarchy management for VSPackages that implement project hierarchies. Please check whether you have installed any packages used to analysis code Coverage in your test. If yes, please uninstall NuGet Packages Manager and re-install it which used to manage VSPackages.

    If still doesn't work, I'm afraid that you need to re-install your Visual Studio again and collect the installation log using  http://aka.ms/vscollect . After using it, you will find vslogs.cab from %temp% folder. Please upload the file to Onedrive and share the link here.

    Best Regards,
    Weiwei

    Friday, December 04, 2015 1:36 AM
    Moderator
  • I was able to determine the problem. My solution includes a NuBuild project, which is a Visual Studio add-in for creating nuget packages. On a hunch I unloaded this project from my solution and that allowed me to run code coverage analysis.
    Thursday, January 14, 2016 2:29 PM