5
votes

So basically when I open my solution with nunit3 & specflow, selenium UI tests in VS 2017 (15.3.2.) I get the following exception and error on test explorer window:

enter image description here

Is there a way to fix this? There is a work around but its ridiculous... If I start VS 2017 without any project and then open the project from recent- its working OK.

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>
2
Pictures error messages are not helpful. Please post the actual text. See meta.stackoverflow.com/questions/303812/…AdrianHHH
Added as text as well.Rain9333

2 Answers

2
votes

The issue appears if you have Test Explorer on focus upon start up. The temp solution is to click on another TAB (Solution explorer) before closing VisualStudio so the focus won't be on TestExplorer on startup.

Ref: https://developercommunity.visualstudio.com/content/problem/117601/test-explorer-nullreferenceexception-on-startup.html

0
votes

The issue appears to be fixed (at least I can't any longer reproduce it) with VS2017 update 15.4.1