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:
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.
Frame identifier: ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}
Frame caption: Test Explorer
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()</description>
</entry>
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With