You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm creating a debug adapter server with Visual Studio 2022 client.
I have encountered an issue with the server initialize process - I got the following exception from VS on Debug adapter initialize:
System.InvalidOperationException: Received 'initialized' event before response to 'initialize' request!
at Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Engine.Implementation.DebuggedProcess.HandleInitializedEvent(InitializedEvent body)
at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.HandleIncomingEvent(String msg)
at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.ProcessMessageBody()
at Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Protocol.DebugProtocol.ReaderThreadProc()
When I looked at the DebugAdapterServer implementation code, I saw that the server is implementing "IDebugAdapterInitializeHandler"
and using an "_initializeComplete" subject to wait for the initialize handle function completetion. After the subject completion the server sends the Initialized event.
In practice, after marking the _initializeComplete subject as completed, we send the Initialized event even duo there is no guarantee that the Initialize response has already been sent back to the VS. We send the Initialize response only when the "Handle" method returns, and not when the _initializeComplete task completed.
Am I missing something? Is that a known issue here?
Thanks!
The text was updated successfully, but these errors were encountered:
alonsh9
changed the title
Debug Adapter Server for Visual Studio
Debug Adapter Server for Visual Studio Initialize issue
Jun 4, 2023
Hi!
I'm creating a debug adapter server with Visual Studio 2022 client.
I have encountered an issue with the server initialize process - I got the following exception from VS on Debug adapter initialize:
When I looked at the DebugAdapterServer implementation code, I saw that the server is implementing "IDebugAdapterInitializeHandler"
and using an "_initializeComplete" subject to wait for the initialize handle function completetion. After the subject completion the server sends the Initialized event.
In practice, after marking the _initializeComplete subject as completed, we send the Initialized event even duo there is no guarantee that the Initialize response has already been sent back to the VS. We send the Initialize response only when the "Handle" method returns, and not when the _initializeComplete task completed.
Am I missing something? Is that a known issue here?
Thanks!
The text was updated successfully, but these errors were encountered: