Visual Studio 2013 is unable to open the Test Window
Asked Answered
B

4

20

When I open Visual Studio 2013 and load my solution I'm greeted by an error message telling me the Test Window is unable to load.

The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Cannot compose part 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal' because a cycle exists in the dependencies between the exports being composed. To break this cycle, consider changing some imports from constructor to property injection.
Element: Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal -->  Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal

Resulting in: Cannot get export 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal (ContractName="Microsoft.VisualStudio.TestWindow.Data.TestsService+ITestsServiceInternal")' from part 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal'.
Element: Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal (ContractName="Microsoft.VisualStudio.TestWindow.Data.TestsService+ITestsServiceInternal") -->  Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal

The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) An operation is not legal in the current state. (Exception from HRESULT: 0x80131509)

Resulting in: An exception occurred while trying to create an instance of type 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost'.

Resulting in: Cannot activate part 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost'.
Element: Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost -->  Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost

Resulting in: Cannot get export 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost (ContractName="Microsoft.VisualStudio.TestWindow.Controller.IOpenResult")' from part 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost'.
Element: Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost (ContractName="Microsoft.VisualStudio.TestWindow.Controller.IOpenResult") -->  Microsoft.VisualStudio.TestWindow.VsHost.TestWindowHost

Resulting in: Cannot set import 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal..ctor (Parameter="openResult", ContractName="Microsoft.VisualStudio.TestWindow.Controller.IOpenResult")' on part 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal'.
Element: Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal..ctor (Parameter="openResult", ContractName="Microsoft.VisualStudio.TestWindow.Controller.IOpenResult") -->  Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal

Resulting in: Cannot get export 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal (ContractName="Microsoft.VisualStudio.TestWindow.Data.TestsService+ITestsServiceInternal")' from part 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal'.
Element: Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal (ContractName="Microsoft.VisualStudio.TestWindow.Data.TestsService+ITestsServiceInternal") -->  Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal

Visual Studio is unable to run tests at all. Closing an re-opening the test window shows the same error.

Billion answered 30/11, 2013 at 15:0 Comment(0)
B
43

This seems to be caused by a corruption in the Component Model Cache.

Close all instances of Visual Studio, then navigate to folder and delete it.

%LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache

Now restart Visual Studio and it should work again.

Billion answered 30/11, 2013 at 15:1 Comment(4)
I don't have the component model cache in visual studio 2013. How do I fix this error?Angell
I have the same error and, although I did have component model cache, removing it did not solve the problem for me.Bracket
I will keep that suggestion in my toolbox. As it turns out, after I removed the component model cache AND THEN EXITED AND RESTARTED VS, the problem was cleared.Bracket
This worked for Visual Studio 2015 for me - replacing 12.0 with 14.0Dunham
A
1

Deleting solution.v12.suo and solution.suo can help resolve the problem as well.

Ammamaria answered 30/5, 2016 at 2:43 Comment(0)
S
1

I tried to best answer (navigate to folder and delete it. %LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache) and it didn't work BUT, based on this method I found the solution which works for me :

navigate to folder and delete it : %LOCALAPPDATA%\Microsoft\WDExpress\11.0\ComponentModelCache

Hope I can help some people this way

Shedd answered 5/11, 2016 at 6:45 Comment(0)
S
0

Just close and re-open Visual Studio (2015) may help.

Scotty answered 6/7, 2016 at 2:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.