3

I have been using the customer preview of Visual Studio 2012 up until day before yesterday when the Release Candidate became available. After I installed the Release Candidate, I can't get to the Test Window (Test / Windows / Test Explorer).

I get the following lengthy error which I've copied manually here. (Since this is my first question, I couldn't post the picture, and the screen would not allow me to copy the text to the clipboard. Hopefully there are no typos.)

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

1) Value cannot be null.
Parameter name: testPlatform

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

Resulting in: Cannot activate part
'Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory'.
Element: Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory -->
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory --> CachedAssemblyCatalog

Resulting in: Cannot get export
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory
(ContractName="Microsoft.VisualStudio.TestWindow.Model.RequestConfigurationFactory")' from part
'Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory'.
Element:
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory
(ContractName="Microsoft.VisualStudio.TestWindow.Model.RequestConfigurationFactory") --> CachedAssemblyCatalog

The error occurs regardless of whether I have opened a solution or not. A second attempt to open the window yields "Cannot create the tool window." After restarting Visual Studio, and attempting to get to the Test Window, I get the long message again.

At the time I upgraded Visual Studio to the Release Candidate, I had installed:

  • NUnit
  • SpecFlow
  • ReSharper (Beta)
  • Code Contracts -- the last thing I had installed before upgrading Visual Studio. I cannot guarantee that the test window was working after I installed this.

I have searched the web for key phrases out of the error message, but found no help.

I have also:

  • Repaired Visual Studio (which solved a problem I was having getting to the Extension Manager, but not the Test Window problem)
  • Uninstalled Visual Studio and reinstalled it
  • Uninstalled each of the Extensions/packages listed above (NUnit, SpecFlow, ReSharper, Code Contracts). Uninstalling didn't seem to help, so I have re-installed all of them, one at a time. I've also confirmed that I can run tests in the ReSharper test window.
  • Deleted the currentsettings.vssettings file from C:\Users\\Documents\Visual Studio 11\Settings, hoping it contained the problem and would be recreated correctly. I got a message that "The IDE will use your most recent settings for this session". I don't know where to find those...
  • Reset settings from the Import and Export Settings option.

None of these actions has helped.

It looks to me like a config file somewhere is missing an element for testPlatform, but I have no idea where that would be (or in what format, or what Options page entry would set it.)

Any help would GREATLY be appreciated.

4

1 回答 1

3

我没有弄清楚究竟是什么导致了错误,但我确实修复了它。这就是最终奏效的方法

我又安装了所有 VS 2012 以及扩展,然后寻找卸载可能留下的位。在重新安装之前,我发现并删除了以下内容:

  • C:\Users\<my id>\Documents\Visual Studio
  • C:\Users\<my id>\AppData\Roaming\Microsoft\VisualStudio
  • C:\Users\<my id>\AppData\Local\Microsoft
  • 注册表:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft

重新安装 Visual Studio 2012 RC 后,原来的问题就解决了。重新安装扩展也成功。

于 2012-06-04T10:28:28.243 回答