Visual Studio: How to Resolve TestWindowPackage.Initialize Failure

Posted by OmegaMan at May 25, 2015

Category: Errors, Visual Studio

Tags:

I began to receive the error message box in Visual Studio after a restart from an install of an unrelated to test Visual Studio plugin (which I have used in the past):

The ‘TestWindowPackage’ package did not load correctly.  … examining the file … AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml

Looking at that log showed these errors:

TestWindowPackage.Initialize failed with exception … System.InvalidOperationException:

Loading MEF components failed with the following exception:
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

No exports were found that match the constraint:
    ContractName    Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
    RequiredTypeIdentity    Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer

 

To resolve the issue I did step 1 and 2 but am showing step 3 in case it helps.

  1. Close all instances of Visual Studio.
  2. Delete all files in `AppData__abENT__#92;Local__abENT__#92;Microsoft__abENT__#92;VisualStudio__abENT__#92;12__abENT__#46;0__abENT__#92;ComponentModelCache` Note that directory is not found in `Roaming` as the activity log file, but in `Local`.
  3. Restart, if that doesn’t work then start over with step 4.
  4. From a Visual Studio Command Line do this operation: `devenv __abENT__#8260;setup __abENT__#8260;ResetSkipPkgs` See (/Setup (devenv.exe)) for more information.
Share

9 Comments

  1. Ron McCormack says

    Thanks.

    Step 1 &2 solved my issue

    Reply
  2. David Allen says

    thanks, steps 1 & 2 fixed my issue as well.
    After deleting the cache, I got a different error on loading. But closed and opened Visual Studio again and it is all better.

    Reply
  3. Alek says

    Many thanks, step 1 fixed the issue for me!

    Some blogs suggested purging the Visual Studio installation completely. Good thing I continued searching for an answer and found your blog. :-)

    For the record, my error messages in ActivityLog were different than yours; however, the actual result was similar, test explorer could not open and show any tests.

    Reply
  4. Anthony says

    Steps 1 and 2 did it!!!! Thank you so much!!!!!!!!!!

    Reply
  5. Andy says

    Step1 and 2 helped !

    Reply
  6. SQL Data Dictionary says

    Brilliant! I thought I was done for. Clearing the folder worked for me.

    Reply
  7. Ben says

    Thank you, I ran into this same issues with Visual Studio 2015 after installing update 2. Steps 1 and 2 fixed it for me.

    Reply
  8. Michael says

    Thanks, after a small path adjustment it worked for Visual Studio 2015:
    %localappdata%\Microsoft\VisualStudio\14.0

    Reply
  9. Henry says

    Soluciono el problema con el primero
    (First step solved it for me).

    Reply

Leave a comment

(required)
(required) (will not be published)

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Recent Comments

    Thanks for this simple yet delightful code....
    Hey guys I'm having the same problem as Netanel KL { “Error HRESUL...
    Soluciono el problema con el primero (First step solved it for me)....
    Thank you! I was looking for this. You save my day!...
    Thank you! This was a big help. My requirement was a little differen...
    Thanks, after a small path adjustment it worked for Visual Studio 2015...
    Good call!...
    Thank you .. this helped...
    How about when you have a long string with no space? I tried it and it...
    Thank you, I ran into this same issues with Visual Studio 2015 after i...
  • Blog Stats

    • 138,574 hits