VS 2017测试资源管理器窗口空引用异常

5

基本上,当我使用nunit3 & specflow,在VS 2017 (15.3.2.)中打开我的解决方案时,我会在测试资源管理器窗口中得到以下异常和错误:

enter image description here

有没有办法解决这个问题?虽然有一个解决方法,但非常荒谬...如果我在不打开任何项目的情况下启动VS 2017,然后从最近打开的项目中打开它,那么它就能正常工作。

An exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\15.0_6ae63cad\ActivityLog.xml".

Exception details:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.InvokeSwapInRealTestWindow(String eventName)
   at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.OnToolWindowCreated()
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id)
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()


ActivityLog.xml content:

  <entry>
    <record>678</record>
    <time>2017/09/15 12:43:31.678</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>Construction of frame content failed.&#x000D;&#x000A;Frame identifier: ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}&#x000D;&#x000A;Frame caption: Test Explorer&#x000D;&#x000A;Exception details:&#x000D;&#x000A;System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.InvokeSwapInRealTestWindow(String eventName)&#x000D;&#x000A;   at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.OnToolWindowCreated()&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid&amp; toolWindowType, Int32 id)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid&amp; toolWindowType, UInt32 id)&#x000D;&#x000A;   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()</description>
  </entry>

图片错误信息并不是很有帮助,请发布实际的文本。请参阅https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors - AdrianHHH
已添加为文本。 - Rain9333
2个回答

2

对我来说仍然不起作用。奇怪的是,对于我的第二个项目,它看起来还好(两者都使用 Selenium 和 NUnit 3)。 - Rain9333

0

看起来问题已经解决了(至少我无法再重现它),这是通过VS2017更新15.4.1实现的。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接