Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Adapter Server for Visual Studio Initialize issue #982

Open
alonsh9 opened this issue Jun 4, 2023 · 0 comments
Open

Debug Adapter Server for Visual Studio Initialize issue #982

alonsh9 opened this issue Jun 4, 2023 · 0 comments

Comments

@alonsh9
Copy link

alonsh9 commented 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:

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!

@alonsh9 alonsh9 changed the title Debug Adapter Server for Visual Studio Debug Adapter Server for Visual Studio Initialize issue Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant