Visual Studio 2013 не может открыть тестовое окно
Когда я открываю Visual Studio 2013 и загружаю свое решение, меня приветствует сообщение об ошибке, указывающее, что тестовое окно не может загрузить.
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 не может запускать тесты вообще. Закрытие повторного открытия тестового окна показывает ту же ошибку.
Ответы
Ответ 1
Это, по-видимому, вызвано повреждением в кэше компонентных моделей.
Закройте все экземпляры Visual Studio, затем перейдите в папку и удалите ее.
% LOCALAPPDATA%\Microsoft\VisualStudio\12,0\ComponentModelCache
Теперь перезапустите Visual Studio, и он снова будет работать.
Ответ 2
Удаление solution.v12.suo и solution.suo также поможет решить проблему.
Ответ 3
Просто закрыть и повторно открыть Visual Studio (2015) может помочь.
Ответ 4
Я попытался ответить лучше (перейдите в папку и удалите ее.% LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache), и это не сработало, но на основе этого метода я нашел решение, которое работает для меня:
перейдите в папку и удалите ее:
% LOCALAPPDATA%\Microsoft\WDExpress\11,0\ComponentModelCache
Надеюсь, я смогу помочь некоторым людям таким образом