6

In Visual Studio 2019 16.6, I tried opening a TSQL file but get this error

An error occurred while initializing the frame's content System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.set_StubInfo(StubWindowInfo value) at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame)

fiat
  • 2,081
  • 1
    Running into this as well, looks like MS is working on a fix

    https://developercommunity.visualstudio.com/content/problem/1048320/recurring-null-reference.html

    – CaseyR Jun 08 '20 at 16:03
  • According to the MS Dev site they have had this bug for years and it still exists in 2024. I am seeing it constantly with VS 2022 17.9.0 Preview 2.1. Apparently they do not know how to fix it. "An error occurred while initializing the frame's content" This bug can happen with any document opened in Visual Studio. – LoneSpawn Jan 17 '24 at 13:26

3 Answers3

2

A work around is to right click, Open With and use a different editor.

This is only temporary however and if you use the other editor as default, it too eventually succumbs to the issue and you have to switch to the original / alternate.

Open With dialog

fiat
  • 2,081
0

Have also encountered this issue. A temporary workaround, for me, has been to restart the application as it seems to happen when I leave Visual Studio 2019 open between remote sessions. Of course, this is not a fix but it seems that Microsoft is working on one.

0

This issue still persists, atm Microsoft Visual Studio Enterprise 2019 Version 16.11.5

Seems that this issue just occurs with RDP connections.

This is the official ticket https://developercommunity2.visualstudio.com/t/An-error-occurred-while-initializing-the/1281388

had
  • 101
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Nov 02 '21 at 09:00